solvapay
v1.3.0
Published
SolvaPay CLI
Readme
solvapay
SolvaPay CLI — authenticate, configure env, and bootstrap SDK integration in an existing repo.
Configure with npx solvapay init · Integrate with @solvapay/server, @solvapay/next, or @solvapay/mcp · Monetize with paywalls, checkout UI, and usage metering.
Quickstart
# Auth + env in an existing project
npx solvapay init
# Skip browser confirmation prompt
npx solvapay init --yes
# Target the SolvaPay dev backend (internal testing only)
npx solvapay init --devAfter init, protect an endpoint:
import { createSolvaPay } from '@solvapay/server'
const solvaPay = createSolvaPay({ apiKey: process.env.SOLVAPAY_SECRET_KEY })
const payable = solvaPay.payable({ product: process.env.SOLVAPAY_PRODUCT_REF! })
app.post('/tasks', payable.http(async args => ({ id: 'task_1', ...args })))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 |
Create MCP apps
For a new paid MCP app (Worker transport, paywall, checkout/account/topup UI, deploy scripts), use the scaffolder — not solvapay init:
npm create solvapay@latest my-mcp-app -- --type mcp
# equivalent: npx create-solvapay@latest my-mcp-app -- --type mcpSee create-solvapay on npm for OpenAPI and from-scratch variants. Use npx solvapay init only to add SolvaPay to a repo that already exists.
Packages
| Package | npm | Purpose |
| --- | --- | --- |
| solvapay | solvapay | CLI — auth + env bootstrap (this package) |
| create-solvapay | create-solvapay | Scaffold new MCP apps |
| @solvapay/server | @solvapay/server | Paywall, API client, webhooks |
| @solvapay/react | @solvapay/react | Checkout UI and hooks |
| @solvapay/next | @solvapay/next | Next.js API route helpers |
| @solvapay/mcp | @solvapay/mcp | Official MCP SDK adapter |
| @solvapay/mcp-core | @solvapay/mcp-core | Framework-neutral MCP contracts |
| @solvapay/auth | @solvapay/auth | Auth adapters |
| @solvapay/react-supabase | @solvapay/react-supabase | Supabase auth for React |
| @solvapay/core | @solvapay/core | Shared types and utilities |
Examples
| Example | Stack | Highlights |
| --- | --- | --- |
| express-basic | Express | Paywall + stub mode |
| checkout-demo | Next.js | Full checkout + Supabase auth |
| hosted-checkout-demo | Next.js | Redirect checkout + portal |
| supabase-edge | Supabase Edge | One-liner @solvapay/server/fetch handlers |
| mcp-oauth-bridge | Node MCP | OAuth bridge + payable.mcp() |
Flags
| Flag | Description |
| --- | --- |
| -y, --yes | Auto-create package.json and skip the browser confirmation prompt. |
| --dev | Target the SolvaPay dev backend (https://api-dev.solvapay.com). Persists SOLVAPAY_API_BASE_URL to .env. Internal testing only — production keys are rejected by api-dev. |
What solvapay init does
- Checks for
package.json(and can create one if missing) - Shows auth URL and asks you to press Enter before opening browser authentication
- Writes
SOLVAPAY_SECRET_KEYto.env(with overwrite confirmation) - Ensures
.envis ignored in.gitignore - Installs
@solvapay/serverand@solvapay/core - Verifies the key and prints a setup summary
Product configuration
After the secret key is verified, solvapay init configures SOLVAPAY_PRODUCT_REF:
- If
.envalready has a real product ref, verifies it and asks whether to keep it ([Y/n]). - Otherwise lists products on your account (newest first, up to 10) and prompts you to pick one.
- With a single product, confirms with
Use "<name>" (prd_xxx)? [Y/n]. - With multiple products, shows a numbered list and accepts
[1-N](default1). - With
--yesor in non-interactive mode, auto-picks the newest product. - With zero products, warns and points to SolvaPay Console → Products — init still completes.
The chosen ref is written to .env. A scaffold placeholder (__SOLVAPAY_PRODUCT_REF__) or a missing ref triggers the picker automatically.
Documentation
Full SDK reference: docs.solvapay.com/sdks/typescript
Support
- Issues: GitHub Issues
- Security: Security Policy
- Docs: docs.solvapay.com
