Complete examples
Every experimental-a2 install includes a complete Next.js playground to copy, run, and read.
Shipped with the package
cp -R node_modules/experimental-a2/examples/playground ./a2-playground
cd a2-playground
pnpm install
pnpm devThe playground lives at node_modules/experimental-a2/examples/playground.
Each feature owns its contract, reducer, server, route handlers, client
session, and scheduler when it needs one, using only public entry points.
The copy is standalone: its package.json pins A2 to the version that
shipped it, and its AGENTS.md describes the structure to coding agents that
work inside the directory.
Find the right example
app/counteris the smallest complete contract, reducer, server, and React client.app/ordersadds handlers and a feature-owned scheduler.app/chatshows request-scoped authorization and durable AI generation.app/agentshows tools, approvals, reminders, and sandboxed commands.app/canvasadds optimistic state, presence, and WebSocket upgrades.app/documentscombines A2 events with a collaborative document protocol.app/recoverydemonstrates queue recovery across function invocations.
Guidance for coding agents
When A2 is installed locally, read these package directories in this order:
node_modules/experimental-a2/docsfor the supported API and guarantees.node_modules/experimental-a2/examples/playgroundfor complete application structure.node_modules/experimental-a2/srconly when implementation details are relevant.
Don't infer application patterns from dist. The playground, generated from
apps/playground in the A2 repository at publish time, is the reference for
how the public pieces fit together.