1
Finish dashboard setup
Before writing any code, complete these steps in the ArcenPay dashboard:
- Create at least one published plan in Catalog → Plans.
- Configure any add-ons, credits, or payment links you want to expose.
- Create and publish a billing component in Components.
- Generate an API key and copy your publishable key from Settings → API Keys.
You need a published plan and a published billing component before
ArcenEmbed can render a checkout or portal surface. Complete this step first.2
Install the SDKs
Install the SDKs relevant to your application architecture:
3
Add environment variables
Variables prefixed with
NEXT_PUBLIC_ are safe to expose in the browser. Keep ARCENPAY_API_KEY, ARCENPAY_WEBHOOK_SECRET, and agent private keys strictly server-side.See API keys and authentication for the definitive guide on which key works with which endpoint — including the modern
sk_, pk_, and rk_ key types.4
Wrap your app with ArcenPayProvider
ArcenPayProvider initializes the React SDK. Add it at the root of your app.ArcenPayProvider must render on the client. In Next.js App Router, add "use client" to the file and import it from your server-rendered root layout.5
Identify the active customer
Call
identify() once your app has resolved the customer’s identity.6
Render ArcenEmbed
ArcenEmbed handles checkout, portal, payment, unsubscribe, and success states.accessToken:7
Enforce access on the server
Never rely solely on client-side entitlement checks. Use the Node SDK to verify access in your API routes.
8
Enable AI Agents and MCP tools (Optional)
If your application interacts with AI agents or exposes autonomous billing workflows, use
@arcenpay/agent to pay payment links or negotiate HTTP 402 micro-settlements:Next steps
- Chains & networks — multi-chain settlement matrix and SDK network configuration
- Agent payments guide — autonomous payments and x402 negotiation
- 15 MCP Tools reference — connect ArcenPay directly to Claude Desktop, Cursor, and LLMs
- Subscription wall — gate entire routes behind an active subscription
- Feature gating — show or hide features based on plan
- Webhooks — listen for billing events to sync your app’s state

