Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

960 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SolvaPay SDK

npm version preview License: MIT

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.

Quickstart

Existing project — auth + env

npx solvapay init

New paid MCP app (recommended)

npm create solvapay@latest my-mcp-app -- --type mcp

Try an example (no API key)

git 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 needed

Skills for coding agents

Using 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

Integration paths

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

Packages

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.

Usage at a glance

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 Router

Client 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.

Examples

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.

Documentation

Development

pnpm install
pnpm build
pnpm test

The monorepo uses Changesets for per-package versioning. See CONTRIBUTING.md for branching, preview publishes, and release workflow.

Security

API keys never reach the browser. Payment flows run through backend routes. Webhook signature verification is included.

Found a vulnerability? See SECURITY.md.

License

MIT — see LICENSE.md.

Support

About

SolvaPay SDK

Resources

Code of conduct

Contributing

Security policy

Stars

5 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages