- A2A extensions and helpers that translate agent card demands such as LLM access, embeddings, OAuth, and secrets into client fulfillments like API keys, model choices, redirect URIs, and secret values, plus UI metadata.
- A platform API client that talks to the AgentStack server.
Quick Start
1. Install
2. Create the platform API client
buildApiClient exposes the platform API with typed responses and runtime validation.
Use the user access token from your identity provider (OIDC/OAuth) for UI side API calls.
3. Create context and context token
ApiResult<T>. Use unwrapResult if you want exceptions, and then handle errors with isHttpError, isNetworkError, isParseError, and isValidationError.
4. Create an A2A client and send a message
Pass the context token to the A2A client fetch. Then fetch the agent card, resolve demands, and stream a message. For a full walkthrough (status updates, user responses, and cancellation), see A2A Client Integration.createAuthenticatedFetch attaches the Authorization header to every request so the A2A client can load the agent card and open JSON RPC streams with authentication.
The agent card URL follows this convention:
{baseUrl}/api/v1/a2a/{providerId}/.well-known/agent-card.json
baseUrlis your Agent Stack server rootproviderIdis the agent provider identifier
getAgentCardPath(providerId) returns the path portion of that URL. Use it with ClientFactory.createFromUrl(baseUrl, agentCardPath) so the client can resolve the full
agent card endpoint.
Architecture overview
SDK entrypoints
The SDK is split into focused entrypoints:agentstack-sdkfor everythingagentstack-sdk/apifor platform API client, schemas, and typesagentstack-sdk/corefor extension helpers and A2A interaction utilitiesagentstack-sdk/extensionsfor A2A extension definitions and types
Protocol Types and Schemas
The SDK exports A2A protocol types and Zod schemas that match the AgentStack UI usage, including:Message,Part, andTasktypesTaskStatusUpdateEventandTaskArtifactUpdateEvent- UI and service extension schemas
Next Steps
- A2A Client Integration for the full streaming, UI events, and response flow
- Agent Requirements for service and UI extension handling
- Agent Responses for rendering message parts and citations
- User Messages for composing user messages with metadata
- Error Handling for platform and extension error patterns
- Platform API Client for endpoint reference and error helpers