npx @insforge/cli secrets get ANON_KEY, or in the dashboard: click Install and open API Keys.
Overview
The TypeScript SDK exposes Razorpay runtime helpers for generated app frontends:insforge.payments.razorpay.createOrder(...)insforge.payments.razorpay.verifyOrder(...)insforge.payments.razorpay.createSubscription(...)insforge.payments.razorpay.verifySubscription(...)insforge.payments.razorpay.cancelSubscription(...)insforge.payments.razorpay.pauseSubscription(...)insforge.payments.razorpay.resumeSubscription(...)
checkoutOptions. The browser loads Razorpay Checkout and opens it with those options.
See Razorpay Payments for provider setup,
manual webhooks, database tables, and fulfillment patterns.
SDK setup
Load Razorpay Checkout
One-time order
Create an app-owned pending order first. Then create the Razorpay Order through InsForge: Razorpay Orders can be amount-only, but creating Razorpay Items for one-time sellable products is a good practice because synced Items make the catalog visible in InsForge and Razorpay. Treat Orders as payment attempts.notes.order_id, pass notes: { order_id: ... } when creating the Order.
Open Razorpay Checkout and verify the returned signature:
Subscription
Create or sync a Razorpay Plan first. Then create the subscription through InsForge:notes when webhook triggers need app identifiers later.
Open Razorpay Checkout with the returned subscription ID:
Manage subscriptions
Razorpay does not provide a Stripe Billing Portal equivalent. Use backend routes for subscription management:INSERT policies on payments.razorpay_subscriptions. Cancel, pause, and resume check UPDATE policies on the same table. PostgreSQL also applies SELECT policies to rows returned by INSERT/UPDATE ... RETURNING, so add matching SELECT visibility for the same billing subject when a policy probe needs to return the row. Add app-specific RLS or server-side membership checks before exposing these controls for shared subjects.
Fulfillment
Do not mark orders paid, grant credits, or activate subscriptions from the Checkout handler alone. Use verified Razorpay webhook events inpayments.webhook_events. Do not attach fulfillment triggers to provider mirror tables such as payments.razorpay_subscriptions.
Create app-owned fulfillment tables with RLS, then update them from webhook triggers. See Razorpay Payments for a trigger example.
Live/test environment
Pass'test' as the first SDK argument while developing. Only switch to 'live' after the developer explicitly approves production Razorpay changes and live Items, Plans, and webhooks are configured.