TypeScript SDK for monetizing APIs, AI agents, and MCP servers — paywall protection, checkout UI, and purchase management.
Configure with npx solvapay init or npm create solvapay -- --type mcp · Integrate with Express, Next.js, Supabase Edge, or MCP · Monetize with paywalls, checkout, and usage metering.
npx solvapay initnpm create solvapay@latest my-mcp-app -- --type mcpgit clone https://github.com/solvapay/solvapay-sdk
cd solvapay-sdk && pnpm install && pnpm build
cd examples/express-basic && pnpm dev # stub mode — no API key neededUsing Claude Code, Codex, Cursor, or other AI coding agents?
Install the SolvaPay skills and describe what you want to build — the router picks the right workflow (MCP app, SDK integration, checkout, etc.).
npx skills add solvapay/skills
| Path | Entry | Packages | Example | Docs |
|---|---|---|---|---|
| Express API | npx solvapay init |
@solvapay/server |
express-basic | Express |
| Next.js checkout | npx solvapay init |
@solvapay/next + @solvapay/react |
checkout-demo | Next.js, React |
| Hosted checkout | npx solvapay init |
@solvapay/next |
hosted-checkout-demo | Purchase management |
| Supabase Edge | npx solvapay init |
@solvapay/server/fetch + @solvapay/react |
supabase-edge | Supabase Edge |
| MCP app (server + UI) | npm create solvapay@latest <name> -- --type mcp |
@solvapay/mcp + @solvapay/react/mcp + @solvapay/server |
scaffold template | MCP, MCP app |
| MCP App UI (advanced) | manual on existing server | @solvapay/mcp + @solvapay/react/mcp |
mcp-checkout-app | MCP app |
| Existing MCP server | npx solvapay init |
@solvapay/server + @solvapay/mcp-core |
mcp-oauth-bridge | MCP |
The SDK ships 10 published npm packages:
| Package | Purpose |
|---|---|
solvapay |
CLI — npx solvapay init for existing repos |
create-solvapay |
Scaffold new MCP apps |
@solvapay/server |
Paywall, API client, webhooks (Node + Edge) |
@solvapay/react |
Headless checkout UI and hooks |
@solvapay/next |
Next.js API route helpers |
@solvapay/mcp |
Official MCP SDK adapter |
@solvapay/mcp-core |
Framework-neutral MCP contracts |
@solvapay/auth |
Auth adapters |
@solvapay/react-supabase |
Supabase auth for React |
@solvapay/core |
Shared types and utilities |
Each package README is the npm landing page for that surface. See docs/contributing/architecture.md for contributor architecture notes.
Server paywall — see @solvapay/server:
import { createSolvaPay } from '@solvapay/server'
const solvaPay = createSolvaPay({ apiKey: process.env.SOLVAPAY_SECRET_KEY })
const payable = solvaPay.payable({ product: 'prd_YOUR_PRODUCT' })
app.post('/tasks', payable.http(handler)) // Express
export const POST = payable.next(handler) // Next.js App RouterClient checkout — see @solvapay/react:
import { SolvaPayProvider, CheckoutLayout } from '@solvapay/react'
<SolvaPayProvider>
<CheckoutLayout productRef="prd_myapi" prefillCustomer={{ email }} />
</SolvaPayProvider>Next.js API routes — see @solvapay/next (not duplicated here).
Supabase Edge — one-liner handlers via @solvapay/server/fetch.
| Example | Stack |
|---|---|
| express-basic | Express paywall + stub mode |
| checkout-demo | Next.js checkout + Supabase |
| hosted-checkout-demo | Redirect checkout + portal |
| supabase-edge | Edge Functions one-liners |
| mcp-oauth-bridge | MCP OAuth + paywall |
See examples/README.md for setup instructions.
- TypeScript SDK — integration guides and API reference
- Architecture — package design (contributors)
- Contributing — development workflow
pnpm install
pnpm build
pnpm testThe monorepo uses Changesets for per-package versioning. See CONTRIBUTING.md for branching, preview publishes, and release workflow.
API keys never reach the browser. Payment flows run through backend routes. Webhook signature verification is included.
Found a vulnerability? See SECURITY.md.
MIT — see LICENSE.md.
- Issues: GitHub Issues
- Email: contact@solvapay.com
- Docs: docs.solvapay.com