@afauthhq/agent for an agent, @afauthhq/server for a service (plus @afauthhq/worker on Cloudflare). @afauthhq/core is the shared foundation both sides pull in.
See Installation for setup, or jump to a quickstart: build an agent or accept AFAuth on your service.
The four packages
| Package | You’re building | Key surface |
|---|---|---|
@afauthhq/agent | An agent | Agent.generate(), signRequest, the protocol builders, TrustClient, AttestedFetcher |
@afauthhq/server | A service | defineService, Server, Verifier, the attestors, RateLimiter, the §10.7 attested-session gate |
@afauthhq/worker | A service on Cloudflare | createWorker + durable KV / D1 / Durable Object stores |
@afauthhq/core | (shared) | did:key codec, RFC 9421 canonicalisation, recipient types, AFAuthError |
How they compose
- Building an agent? Install
@afauthhq/agent— or skip code entirely and use theafauthCLI. - Operating a service? Install
@afauthhq/server. On Cloudflare Workers, add@afauthhq/workerforcreateWorkerand the durable stores. @afauthhq/corecomes along transitively — you rarely import it directly, except for shared types likeAFAuthErrorandRecipient.
These overview pages map the surface; per-symbol typedoc reference is planned but not yet published. The quickstarts and guides carry runnable, copyable code for the common paths.
Where to next
Quickstart: build an agent
@afauthhq/agent end to end in five minutes.Quickstart: accept AFAuth
@afauthhq/server with spam-resistant defaults.Installation
npm / pnpm / yarn, Node 20+.
Use the CLI instead
The same agent flow with no code.