CLI
paylynks sets up an app for payments in one command.
npx paylynks init
Until the package is on npm, run it from PayLynks directly:
npx https://paylynks.io/downloads/paylynks-cli.tgz init
init
Shows the files it will add and asks to continue.
Opens
https://paylynks.io/cliin your browser with a code. Sign in, check the code matches, pick the company, approve. (If your project already hasPAYLYNKS_SECRET_KEY, it uses that and skips sign-in.)Creates new test API keys and writes them to your env file:
.env.localfor Next.js,supabase/functions/.envfor Vite/React and Supabase,.envfor Express. The keys are minted at that moment and returned once; they're never printed or stored by PayLynks in plain text. The env file is added to.gitignoreif it isn't already covered.Detects your framework and writes starter files. For Next.js (App Router, with or without
src/):app/api/paylynks/checkout/route.tscomponents/PayLynksCheckout.tsxapp/checkout/page.tsxapp/api/paylynks/webhook/route.ts
For Vite/React it writes
src/PayLynksCheckout.jsx, and if there's asupabase/folder,supabase/functions/paylynks-checkout/index.ts.Never overwrites an existing file unless you pass
--force.
Options: --secret-key sk_test_… to skip the browser (CI, agents), --framework nextjs|react|supabase|node|html, --force, --yes, --no-browser, --dir <path>.
webhooks add
After you deploy, register your webhook URL and save its signing secret to .env.local:
npx paylynks webhooks add https://your-app.com/api/paylynks/webhook
Use npx paylynks webhooks test <endpoint_id> to send a signed test event.
Other commands
npx paylynks login— sign in again and write fresh test keys to your env file.npx paylynks webhooks list— list your endpoints.npx paylynks docs [page]— print a docs page as markdown (no page: the llms.txt index).
Revoke keys the CLI created under Developers → API keys in the dashboard.