@adcp/sdk API Reference - v17.0.0-rc.0
    Preparing search index...

    Interface CreativeAgentClientConfig

    Configuration for CreativeAgentClient

    interface CreativeAgentClientConfig {
        maxHistorySize?: number;
        persistConversations?: boolean;
        workingTimeout?: number;
        defaultMaxClarifications?: number;
        agentUrl: string;
        protocol?: "mcp" | "a2a";
        authToken?: string;
        legacyFormatConverter?: LegacyFormatConverter;
        experimentalIdentity33?: boolean;
        webhookSigningProfile?: "adcp/webhook-signing/v1" | "web-bot-auth";
        accountPolicy?: AccountPolicy;
        accountReferenceMode?: "auto" | "natural-key";
        accountStorage?: BuyerAccountStorage;
        reportingEventStore?: ReportingEventStore;
        accountRegistryMaxEntries?: number;
        accountRegistryOptions?: Pick<
            BuyerAccountRegistryOptions,
            "onResult"
            | "onDispatchStart",
        >;
        accountRegistryScope?: string;
        productCache?: ProductCache;
        discoveryCache?: AgentDiscoveryCacheConfig;
        deferredStorage?: DeferredTaskStorage;
        resolveDeferredAgent?: (
            agentId: string,
        ) => AgentConfig | Promise<AgentConfig | undefined> | undefined;
        deferredTaskTtlSeconds?: number;
        projectionCatalogs?: readonly ProjectionCatalogSnapshot[];
        canonicalFormatLegacyResolver?: CanonicalFormatLegacyResolver;
        adcpVersion?:
            | "3.0"
            | "3.1"
            | string & {}
            | "3.3.0-rc.3"
            | "v3"
            | "3.0.0"
            | "3.0.1"
            | "3.0.2"
            | "3.0.3"
            | "3.0.4"
            | "3.0.5"
            | "3.0.6"
            | "3.0.7"
            | "3.0.8"
            | "3.0.9"
            | "3.0.10"
            | "3.0.11"
            | "3.0.12"
            | "3.0.13"
            | "3.0.14"
            | "3.0.15"
            | "3.0.16"
            | "3.0.17"
            | "3.0.18"
            | "3.0.19"
            | "3.0.20"
            | "3.0.21"
            | "3.0.22"
            | "3.0.23"
            | "3.0.24"
            | "3.0.25"
            | "3.1.0"
            | "3.1.1"
            | "3.1.2"
            | "3.1.3"
            | "3.1.4"
            | "3.1.5"
            | "3.1.6"
            | "3.1.7"
            | "3.1.8"
            | "3.1.9"
            | "3.1.10"
            | "3.1.11"
            | "3.1.12"
            | "3.1.13"
            | "3.1.14"
            | "3.1.15"
            | "3.1.16"
            | "3.1.17"
            | "3.1.18"
            | "3.1.19"
            | "3.1.20"
            | "3.1.21"
            | "3.1.22"
            | "3.1.23"
            | "3.1.24"
            | "3.1.25"
            | "3.1.26"
            | "3.1.27"
            | "3.1.28"
            | "3.1.29"
            | "3.1.30"
            | "3.1.31"
            | "3.2.1"
            | "3.2"
            | "3.2.2"
            | "3.2.3"
            | "3.2.4"
            | "3.2.5"
            | "3.2.6"
            | "3.2.7"
            | "3.2.8"
            | "3.3-rc.3";
        wireAdcpVersion?: | "3.0"
        | "3.1"
        | string & {}
        | "3.3.0-rc.3"
        | "v3"
        | "3.0.0"
        | "3.0.1"
        | "3.0.2"
        | "3.0.3"
        | "3.0.4"
        | "3.0.5"
        | "3.0.6"
        | "3.0.7"
        | "3.0.8"
        | "3.0.9"
        | "3.0.10"
        | "3.0.11"
        | "3.0.12"
        | "3.0.13"
        | "3.0.14"
        | "3.0.15"
        | "3.0.16"
        | "3.0.17"
        | "3.0.18"
        | "3.0.19"
        | "3.0.20"
        | "3.0.21"
        | "3.0.22"
        | "3.0.23"
        | "3.0.24"
        | "3.0.25"
        | "3.1.0"
        | "3.1.1"
        | "3.1.2"
        | "3.1.3"
        | "3.1.4"
        | "3.1.5"
        | "3.1.6"
        | "3.1.7"
        | "3.1.8"
        | "3.1.9"
        | "3.1.10"
        | "3.1.11"
        | "3.1.12"
        | "3.1.13"
        | "3.1.14"
        | "3.1.15"
        | "3.1.16"
        | "3.1.17"
        | "3.1.18"
        | "3.1.19"
        | "3.1.20"
        | "3.1.21"
        | "3.1.22"
        | "3.1.23"
        | "3.1.24"
        | "3.1.25"
        | "3.1.26"
        | "3.1.27"
        | "3.1.28"
        | "3.1.29"
        | "3.1.30"
        | "3.1.31"
        | "3.2.1"
        | "3.2"
        | "3.2.2"
        | "3.2.3"
        | "3.2.4"
        | "3.2.5"
        | "3.2.6"
        | "3.2.7"
        | "3.2.8"
        | "3.3-rc.3";
        versionEnvelope?: VersionEnvelopeMode;
        debug?: boolean;
        userAgent?: string;
        headers?: Record<string, string>;
        onActivity?: (activity: Activity) => void | Promise<void>;
        onTransportActivity?: TransportActivityHandler;
        handlers?: AsyncHandlerConfig;
        isolateStatusHandlerErrors?: boolean;
        onStatusHandlerError?: (
            error: unknown,
            context: StatusHandlerErrorContext,
        ) => void | Promise<void>;
        webhookSecret?: string;
        webhookRegistrationStore?: WebhookRegistrationStore;
        webhookRegistrationTtlSeconds?: number;
        webhookVerification?: WebhookVerificationConfig;
        allowUnauthenticatedWebhooks?: boolean;
        webhookUrlTemplate?: WebhookUrlTemplate;
        reportingWebhookFrequency?: "daily" | "monthly" | "hourly";
        validateFeatures?: boolean;
        requireV3ForMutations?: boolean;
        accountIdentityDowngrade?: AccountIdentityDowngrade;
        validation?: {
            requests?: ValidationMode;
            responses?: ValidationMode;
            strictSchemaValidation?: boolean;
            logSchemaViolations?: boolean;
            filterInvalidProducts?: boolean;
            rejectProductsWithoutPricingOptions?: boolean;
            productPropertyPolicy?: false | ClientProductPropertyPolicy;
            supplyPathVerification?: ProductSupplyPathOptions;
        };
        governance?: GovernanceConfig;
        transport?: TransportOptions;
    }

    Hierarchy (View Summary)

    Index
    maxHistorySize?: number

    Maximum messages to keep in history

    persistConversations?: boolean

    Whether to persist conversations

    workingTimeout?: number

    Resettable idle/progress timeout for protocol work in 'working' status.

    defaultMaxClarifications?: number

    Default max clarifications

    agentUrl: string

    Creative agent URL

    protocol?: "mcp" | "a2a"

    Protocol to use (defaults to 'mcp')

    authToken?: string

    Authentication token if required

    legacyFormatConverter?: LegacyFormatConverter

    Migration converter for seller-specific legacy creative references.

    experimentalIdentity33?: boolean

    Enable pinned draft identity schemas and positively negotiated 3.3 webhook rules.

    webhookSigningProfile?: "adcp/webhook-signing/v1" | "web-bot-auth"
    accountPolicy?: AccountPolicy

    Default off disables provisioning gates; auto/strict use the provisioning registry.

    accountReferenceMode?: "auto" | "natural-key"

    Auto sends a provisioned account's seller account_id in place of its natural key on account-scoped tasks negotiated at AdCP 3.3 or later (or when the seller declares stable_account_id). Natural-key sends every reference as written.

    accountStorage?: BuyerAccountStorage
    reportingEventStore?: ReportingEventStore

    Where client.reporting.poll() keeps the acknowledged event snapshot (experimental, AdCP 3.3). Defaults to process-local; a serverless consumer passes postgresStorage({ pool }).events.

    accountRegistryMaxEntries?: number
    accountRegistryOptions?: Pick<
        BuyerAccountRegistryOptions,
        "onResult"
        | "onDispatchStart",
    >
    accountRegistryScope?: string

    Trusted stable caller identity for durable registry partitioning. Default is credential fingerprint.

    productCache?: ProductCache
    discoveryCache?: AgentDiscoveryCacheConfig

    Share endpoint discovery, the tools/list schema map and get_adcp_capabilities across client instances. Opt-in: nothing is shared unless a cache and a caller-owned authIdentity are supplied.

    Entries are keyed by agent URL, authIdentity, the pinned AdCP version, the non-correlation request headers (tenant/routing headers included), the signing identity and the transport policy (allowPrivateIp, maxResponseBytes), and expire after ttlMs. Synthetic capabilities (a seller whose capabilities call failed or that has no get_adcp_capabilities) are never shared, and calls that use a scoped trustedFetchFn bypass the cache entirely. See docs/guides/DISCOVERY-CACHE-AND-SESSION-REUSE.md.

    deferredStorage?: DeferredTaskStorage

    Durable storage for restart-safe A2A human continuations.

    resolveDeferredAgent?: (
        agentId: string,
    ) => AgentConfig | Promise<AgentConfig | undefined> | undefined

    Resolve current trusted agent configuration for a persisted continuation.

    deferredTaskTtlSeconds?: number

    Lifetime of a persisted continuation token in seconds. Defaults to seven days.

    projectionCatalogs?: readonly ProjectionCatalogSnapshot[]

    Pre-resolved exact-owner publisher/community catalogs used at every projection boundary.

    canonicalFormatLegacyResolver?: CanonicalFormatLegacyResolver

    Resolver for persisted canonical selections when a negotiated legacy wire is required.

    adcpVersion?:
        | "3.0"
        | "3.1"
        | string & {}
        | "3.3.0-rc.3"
        | "v3"
        | "3.0.0"
        | "3.0.1"
        | "3.0.2"
        | "3.0.3"
        | "3.0.4"
        | "3.0.5"
        | "3.0.6"
        | "3.0.7"
        | "3.0.8"
        | "3.0.9"
        | "3.0.10"
        | "3.0.11"
        | "3.0.12"
        | "3.0.13"
        | "3.0.14"
        | "3.0.15"
        | "3.0.16"
        | "3.0.17"
        | "3.0.18"
        | "3.0.19"
        | "3.0.20"
        | "3.0.21"
        | "3.0.22"
        | "3.0.23"
        | "3.0.24"
        | "3.0.25"
        | "3.1.0"
        | "3.1.1"
        | "3.1.2"
        | "3.1.3"
        | "3.1.4"
        | "3.1.5"
        | "3.1.6"
        | "3.1.7"
        | "3.1.8"
        | "3.1.9"
        | "3.1.10"
        | "3.1.11"
        | "3.1.12"
        | "3.1.13"
        | "3.1.14"
        | "3.1.15"
        | "3.1.16"
        | "3.1.17"
        | "3.1.18"
        | "3.1.19"
        | "3.1.20"
        | "3.1.21"
        | "3.1.22"
        | "3.1.23"
        | "3.1.24"
        | "3.1.25"
        | "3.1.26"
        | "3.1.27"
        | "3.1.28"
        | "3.1.29"
        | "3.1.30"
        | "3.1.31"
        | "3.2.1"
        | "3.2"
        | "3.2.2"
        | "3.2.3"
        | "3.2.4"
        | "3.2.5"
        | "3.2.6"
        | "3.2.7"
        | "3.2.8"
        | "3.3-rc.3"

    AdCP protocol version this client speaks to agents. Defaults to ADCP_VERSION — the GA version the SDK ships against. Override to pin to an older stable (e.g., '3.0.0') or opt into a beta channel ('3.1.0-beta.1') once that registry ships.

    Stage 2 plumbs the option through and validates it at construction time; cross-major pins (e.g. '4.0.0-beta.1' while the SDK ships against major 3) throw ConfigurationError. Stage 3 wires per-instance schema/validator selection off this field.

    Typed as AdcpVersion | (string & {}) so editors autocomplete canonical values from COMPATIBLE_ADCP_VERSIONS while still accepting forward-compatible strings.

    wireAdcpVersion?:
        | "3.0"
        | "3.1"
        | string & {}
        | "3.3.0-rc.3"
        | "v3"
        | "3.0.0"
        | "3.0.1"
        | "3.0.2"
        | "3.0.3"
        | "3.0.4"
        | "3.0.5"
        | "3.0.6"
        | "3.0.7"
        | "3.0.8"
        | "3.0.9"
        | "3.0.10"
        | "3.0.11"
        | "3.0.12"
        | "3.0.13"
        | "3.0.14"
        | "3.0.15"
        | "3.0.16"
        | "3.0.17"
        | "3.0.18"
        | "3.0.19"
        | "3.0.20"
        | "3.0.21"
        | "3.0.22"
        | "3.0.23"
        | "3.0.24"
        | "3.0.25"
        | "3.1.0"
        | "3.1.1"
        | "3.1.2"
        | "3.1.3"
        | "3.1.4"
        | "3.1.5"
        | "3.1.6"
        | "3.1.7"
        | "3.1.8"
        | "3.1.9"
        | "3.1.10"
        | "3.1.11"
        | "3.1.12"
        | "3.1.13"
        | "3.1.14"
        | "3.1.15"
        | "3.1.16"
        | "3.1.17"
        | "3.1.18"
        | "3.1.19"
        | "3.1.20"
        | "3.1.21"
        | "3.1.22"
        | "3.1.23"
        | "3.1.24"
        | "3.1.25"
        | "3.1.26"
        | "3.1.27"
        | "3.1.28"
        | "3.1.29"
        | "3.1.30"
        | "3.1.31"
        | "3.2.1"
        | "3.2"
        | "3.2.2"
        | "3.2.3"
        | "3.2.4"
        | "3.2.5"
        | "3.2.6"
        | "3.2.7"
        | "3.2.8"
        | "3.3-rc.3"

    Optional wire-only AdCP version envelope override. Request/response validation still uses adcpVersion; protocol envelopes use this value.

    versionEnvelope?: VersionEnvelopeMode

    Controls emission of AdCP version envelope fields. Defaults to auto. none is primarily for conformance harnesses that need to send a request exactly as authored, without SDK-managed version fields.

    debug?: boolean

    Enable debug logging

    userAgent?: string

    Custom User-Agent header sent with all outbound protocol requests. Overridden by per-agent headers['User-Agent'] if set.

    headers?: Record<string, string>

    Additional headers to include in requests

    onActivity?: (activity: Activity) => void | Promise<void>

    Activity callback for observability (logging, UI updates, etc)

    onTransportActivity?: TransportActivityHandler

    Transport-level diagnostics callback for outbound HTTP requests.

    Receives sanitized request/response/failure events from the SDK's protocol fetch layer. Header maps are allowlisted/redacted and URLs have credentials, query strings, and fragments stripped before emission.

    Task completion handlers — called for both sync responses and webhook completions.

    For at-least-once webhook delivery, set handlers.webhookDedup to drop duplicate retries by idempotency_key. See docs/guides/PUSH-NOTIFICATION-CONFIG.md#deduplication. For per-call skipping and inline error isolation, see docs/guides/PUSH-NOTIFICATION-CONFIG.md#inline-completion-handlers.

    isolateStatusHandlerErrors?: boolean

    Return successful completed results even if an inline status handler throws. Defaults to false, preserving handler rejection and durable finalization retry. Does not change webhook error handling or cancellation behavior.

    onStatusHandlerError?: (
        error: unknown,
        context: StatusHandlerErrorContext,
    ) => void | Promise<void>

    Reports inline status-handler errors when isolateStatusHandlerErrors is true. Errors thrown by this observer are recorded as warnings and do not reject the task.

    webhookSecret?: string

    Select legacy HMAC-SHA256 push verification. Omit to use RFC 9421.

    webhookRegistrationStore?: WebhookRegistrationStore

    Durable provenance for outbound push registrations. Defaults to process-local memory.

    webhookRegistrationTtlSeconds?: number

    Registration retention in seconds. Defaults to seven days.

    webhookVerification?: WebhookVerificationConfig

    RFC 9421 key, replay, revocation, and discovery configuration.

    allowUnauthenticatedWebhooks?: boolean

    Accept inbound webhooks that carry no verifiable authenticity at all.

    This bypass applies only when no trusted push registration exists and no HMAC secret is configured. It never bypasses a failed RFC 9421 or HMAC verification for a known registration.

    Set this only when the receiver is genuinely unreachable from outside your network (in-process test harnesses, a route bound to loopback). It is not a substitute for a secret on any route an agent can reach over the internet.

    false
    
    webhookUrlTemplate?: WebhookUrlTemplate

    Webhook URL template with macro substitution

    Available macros:

    • {agent_id} - Agent ID
    • {task_type} - Task type (e.g., sync_creatives, media_buy_delivery)
    • {operation_id} - Operation ID
    Path-based: "https://myapp.com/webhook/{task_type}/{agent_id}/{operation_id}"
    Query string: "https://myapp.com/webhook?agent={agent_id}&op={operation_id}&type={task_type}"
    Custom: "https://myapp.com/api/v1/adcp/{agent_id}?operation={operation_id}"
    reportingWebhookFrequency?: "daily" | "monthly" | "hourly"

    Reporting webhook frequency

    'daily'
    
    validateFeatures?: boolean

    Validate that the seller supports required features before each task call. When true, tasks like syncAudiences will fail fast with FeatureUnsupportedError if the seller hasn't declared audience_targeting support.

    true
    
    requireV3ForMutations?: boolean

    Require release compatibility and the declared idempotency replay TTL before mutations.

    accountIdentityDowngrade?: AccountIdentityDowngrade

    What to do when a request reaches a seller on an older AdCP release and its account key uses fields that release cannot express. AdCP 3.2 added operator_unit, currency and timezone to the account natural key and countries to brand references; a 3.1 seller's key has none of them.

    • 'refuse' (default): fail the call before it is sent with ProtocolFeatureUnsupportedError.
    • 'reduce': send the older key when that is unambiguous, and refuse when it would merge accounts. Each reduced key is claimed for the one buyer key it came from (a key sent unreduced claims itself), and a second buyer key that would reach the same seller account fails with account_identity_collision before sending, so no two buyer accounts share one seller account. Each reduction is reported in debug_logs as an account_identity_reduced entry. Requires accountStorage with compareAndSet, so the claims hold across instances and restarts.

    The rule is proposed for the spec as adcontextprotocol/adcp DR-0032 (#8373); the default may change to 'reduce' once it is ratified.

    'refuse'
    
    validation?: {
        requests?: ValidationMode;
        responses?: ValidationMode;
        strictSchemaValidation?: boolean;
        logSchemaViolations?: boolean;
        filterInvalidProducts?: boolean;
        rejectProductsWithoutPricingOptions?: boolean;
        productPropertyPolicy?: false | ClientProductPropertyPolicy;
        supplyPathVerification?: ProductSupplyPathOptions;
    }

    Runtime schema validation options

    Type Declaration

    • Optionalrequests?: ValidationMode

      Validate outgoing requests against the bundled AdCP JSON schema before dispatch. Catches field-name drift at call-time instead of at storyboard-time.

      • strict: throw ValidationError with a JSON Pointer to the bad field
      • warn: log to debug logs and continue
      • off: skip the validator entirely (no overhead)

      strict in dev/test, warn in production

    • Optionalresponses?: ValidationMode

      Validate incoming responses against the bundled AdCP JSON schema.

      • strict: fail the task with VALIDATION_ERROR
      • warn: log to debug logs and surface the task as successful
      • off: skip the validator entirely

      Overrides strictSchemaValidation when set.

      strict in dev/test, warn in production

    • OptionalstrictSchemaValidation?: boolean

      Legacy: fail tasks when response schema validation fails (default: true). Superseded by responses above — retained for backward compat. false maps to responses: 'warn' when responses isn't set.

      true
      
    • OptionallogSchemaViolations?: boolean

      Emit schema validation violations to debug logs and the console (default: true). Set false when violations are surfaced through another structured channel.

      true
      
    • OptionalfilterInvalidProducts?: boolean

      Filter out invalid products from get_products responses instead of rejecting the entire response (default: false)

      When true: Each product in a get_products response is validated individually. Valid products are kept, invalid products are dropped, and the response is returned as long as it passes full schema validation after filtering. When false: The entire response is rejected if any product fails validation.

      Only applies to get_products — all other tool responses use standard validation.

      false
      
    • OptionalrejectProductsWithoutPricingOptions?: boolean

      Reject products that arrive without a usable pricing_options[] array from completed get_products responses (default: true).

      pricing_options is a required, non-empty field in AdCP 3.1 — a product that advertises no pricing model is non-transactable, so the SDK drops it from the product list before callers and completion handlers see it. This runs on every completion path (sync, polling, track, webhook) and is independent of the response validation mode, so unpriced products are removed even under responses: 'warn' | 'off'. The rejection is recorded in result.metadata.productPricingPolicy and a product_missing_pricing_options debug-log notice.

      Set to false to pass products through untouched (e.g. when the caller deliberately inspects malformed seller responses).

      true
      
    • OptionalproductPropertyPolicy?: false | ClientProductPropertyPolicy

      Buyer-side property policy applied to completed get_products responses before completion handlers and callers receive the product list. A request-level property_list is enforced automatically by default; set this to false only when the caller deliberately wants to trust seller-side filtering without SDK verification.

      Use this for brand/block-list rules such as excluding ladbible.com; domain matching normalizes www. aliases, so www.ladbible.com violates an exclusion for ladbible.com.

    • OptionalsupplyPathVerification?: ProductSupplyPathOptions

      Opt in to computed, evidence-bearing external collection path annotations on product discovery.

    governance?: GovernanceConfig

    Governance configuration for buyer-side campaign governance

    transport?: TransportOptions

    Transport-level safeguards. Applies to every call this client dispatches unless overridden at call time.

    maxResponseBytes defaults to 4 MiB on every call; raise it for an agent that legitimately publishes a large catalog, lower it when crawling untrusted agents (registries, federated discovery layers), or set it to exactly 0 to opt out of the cap entirely. A per-call transport replaces this object wholesale rather than merging into it. Set requestTimeoutMs to override the default 60s cap on A2A agent-card discovery; use 0 to disable the SDK-imposed discovery timeout.