Prerequisites
- Node.js version 18.17 or higher
- A project directory where you want to add SolvaPay
Run setup
From your project root:What this command does
When you runnpx solvapay init, the CLI:
- Checks for
package.jsonand offers to create one if missing - Detects your package manager (
npm,yarn, orpnpm) - Opens your browser so you can sign in to SolvaPay Console
- Writes
SOLVAPAY_SECRET_KEYto.env - Ensures
.envis listed in.gitignore - Installs
@solvapay/server,@solvapay/core, and@solvapay/auth - Verifies your secret key with SolvaPay
- Prints a quick start snippet
Files the CLI creates or updates
| File | What changes |
|---|---|
package.json | Created if missing (after confirmation) |
.env | Adds or updates SOLVAPAY_SECRET_KEY |
.gitignore | Adds .env if needed |
node_modules and lockfile | Installs base SolvaPay SDK packages |
Add stack-specific packages
solvapay init installs the base server packages. Add framework packages based on your stack:
- Next.js:
@solvapay/nextand usually@solvapay/react - React:
@solvapay/react(and@solvapay/react-supabaseif using Supabase) - MCP Server:
@solvapay/serveris already installed by init
Re-run setup safely
You can runnpx solvapay init again at any time.
If SOLVAPAY_SECRET_KEY already exists, the CLI asks whether you want to overwrite it:
- Choose
yto replace it with a new key - Choose
nto keep your current key
Scope
This command is the recommended get-started path for SDK integration. If you are using Hosted MCP Pay (no-code), you do not need this CLI flow.Next steps
- Installation for manual and framework-specific package setup
- Quick Start to protect your first endpoint
- Core Concepts to understand products, plans, and paywall behavior