ADK for TypeScript: API Reference
    Preparing search index...

    Interface ToA2aOptions

    Options for the toA2a function.

    interface ToA2aOptions {
        agentCard?: string | AgentCard;
        allowUnauthenticated?: boolean;
        app?: Application;
        artifactService?: BaseArtifactService;
        authentication?: UserBuilder;
        basePath?: string;
        host?: string;
        memoryService?: BaseMemoryService;
        port?: number;
        protocol?: string;
        runner?: Runner;
        sessionService?: BaseSessionService;
    }

    Properties

    agentCard?: string | AgentCard

    Optional pre-built AgentCard object or path to agent card JSON

    allowUnauthenticated?: boolean

    Explicit escape hatch to mount the A2A surface WITHOUT authentication.

    This is intentionally insecure and must only be used for local, trusted development where the surface is not network reachable. When set to true (and no ToA2aOptions.authentication is provided), a loud warning is logged and the handlers are mounted with no authentication.

    Defaults to false, which makes toA2a fail closed.

    app?: Application

    Optional existing express application

    artifactService?: BaseArtifactService

    Optional artifact service

    authentication?: UserBuilder

    Authenticator used to validate incoming A2A requests.

    A2A is the production-intended inter-agent surface: any network-reachable caller that can reach it can invoke the agent and its tools with arbitrary input and read the output. Provide a UserBuilder (from @a2a-js/sdk/server/express) that validates the request's credentials — for example a bearer token or an OIDC ID token — and it will be wired into both the REST and JSON-RPC handlers.

    When omitted, toA2a fails closed and throws unless ToA2aOptions.allowUnauthenticated is explicitly set to true.

    basePath?: string

    The base path for the A2A RPC URL (default: "a2a")

    host?: string

    The host for the A2A RPC URL (default: "localhost")

    memoryService?: BaseMemoryService

    Optional memory service

    port?: number

    The port for the A2A RPC URL (default: 8000)

    protocol?: string

    The protocol for the A2A RPC URL (default: "http")

    runner?: Runner

    Optional pre-built Runner object

    sessionService?: BaseSessionService

    Optional session service