Source:
examples/x402-sessionsOverview
This template demonstratesSessionPlugin — payer-scoped key-value storage gated by x402 payment identity. Each x402 signer gets isolated storage that persists across requests. Two different payers never see each other’s data.
Project Structure
Session Store
SessionPlugin is auto-registered by the build pipeline. To customize the store, createapp/session.ts:
app/session.ts
app/session.ts is not present, the default InMemorySessionStore is used automatically.
Using Sessions in Tools
Tools access the session viagetSession() — no need to pass payer identity manually:
app/tools/put-content.ts
Skills
| Skill | Description | Price |
|---|---|---|
put-content | Store key-value content in payer-scoped session | $0.01 |
get-content | Retrieve stored content from session | $0.001 |
Running
SessionPlugin API
Full API reference for SessionPlugin, Session, and SessionStore.
x402 Payments
Payment protocol that provides payer identity for sessions.