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

    Interface A2AAdapterOptions

    Options for createA2AAdapter.

    Auth posture. authenticate(req) runs BEFORE the tool handler sees the request. Return an AdcpAuthInfo to let the pipeline proceed with that principal; return null (or throw) to reject. A rejection currently surfaces as a generic JSON-RPC -32000 server error — the @a2a-js/sdk doesn't yet expose a typed authentication-failed code for the UserBuilder path. Production deployments SHOULD wire upstream middleware (e.g. express-jwt) to reject with a proper HTTP 401 / WWW-Authenticate challenge before the request reaches jsonRpcHandler. The authenticate option here is a last-line-of-defense guard, not the primary auth surface.

    Agent-card securitySchemes. Legacy 0.3 OpenAPI-style schemes are converted to the A2A 1.0 union and unsupported shapes fail at startup. Only put non-secret discovery data there (token endpoint, scopes, OIDC issuer URL). Never paste client secrets, private JWKS, or internal URLs into the card.

    Omitting authenticate makes the adapter anonymous — handlers see ctx.authInfo === undefined, matching serve({ authenticate: undefined }).

    interface A2AAdapterOptions {
        server: AdcpServer;
        authenticate?: (req: Request) => Promise<AdcpAuthInfo | null>;
        agentCard: A2AAgentCardOverrides;
        taskStore?: TaskStore;
        logger?: AdcpLogger;
        legacyCompat?: A2ALegacyCompatOptions;
        preTransport?: AdcpPreTransport;
        signedRequestsUrl?: (req: Request) => string;
        allowUnenforcedSignedRequests?: boolean;
    }
    Index
    server: AdcpServer

    AdCP server whose registered tools this adapter exposes over A2A.

    authenticate?: (req: Request) => Promise<AdcpAuthInfo | null>

    Authenticate an inbound A2A request. Transport-level auth runs before AdcpServer.invoke() so the framework pipeline sees a verified authInfo. Return null (or throw) to reject.

    Seller-supplied agent-card identity fields. Required.

    taskStore?: TaskStore

    A2A task store. Tests and development default to the SDK's in-memory store. Production must supply a bounded, durable implementation.

    logger?: AdcpLogger

    Optional logger. Falls back to console.

    legacyCompat?: A2ALegacyCompatOptions

    Controls the official A2A SDK's v0.3 compatibility handlers and agent-card interface. Defaults to { enabled: true } for backwards compatibility. Set enabled: false to expose only the native A2A 1.0 path.

    preTransport?: AdcpPreTransport

    RFC 9421 request-signature gate for the JSON-RPC endpoint. Defaults to the verifier that createAdcpServer({ signedRequests }) attaches to server, so a seller that configures signedRequests enforces required_for, protocol_methods_required_for and the webhook-authentication rule over A2A exactly as it does over MCP. Pass it explicitly when you wired the verifier by hand (serve({ preTransport })).

    The gate runs on every POST to the JSON-RPC endpoint, before A2AAdapterOptions.authenticate. The adapter buffers the request body itself so the gate sees the exact signed bytes, resolves the AdCP operation from the Message's sole DataPart (skill), and rejects a body that does not resolve to exactly one operation with request_body_malformed before any handler runs. The dispatcher then runs only that operation. Unlike authenticate, a gate rejection is an HTTP 401 carrying WWW-Authenticate: Signature error="<code>".

    A verified signature is surfaced to handlers as ctx.authInfo (clientId: signing:<keyid>). When authenticate is also set, its result stays authoritative and must carry the same clientId.

    Body capture: do not mount a body parser ahead of the adapter unless it records the raw bytes (express.json({ verify: adapter.rawBodyVerify })); a request whose raw body is unavailable is rejected.

    signedRequestsUrl?: (req: Request) => string

    Canonical URL a client signed for this request (the signature's @target-uri). Defaults to the origin of agentCard.url plus the request's original path and query. Override when a path-rewriting proxy changes the path between the client and this process. Never derive it from a client-controlled Host / X-Forwarded-* header.

    allowUnenforcedSignedRequests?: boolean

    Acknowledge that a seller advertising signed-requests / request_signing is not verifying signatures on this adapter (for example, an authenticating gateway in front of it does). Without this, createA2AAdapter refuses to construct when server advertises request signing but no gate is wired, because the advertisement would be false for A2A.