How to add subscriptions to a Next.js app without Stripe
To add subscriptions to a Next.js app without Stripe, install the @getruba/nextjs adapter and mount three routes: checkout, customer portal and webhooks. Ruba is the Merchant of Record, so it takes the card, handles supported taxes and pays you to your own bank, with no company needed.
The plan, in five steps
Vikram in Hyderabad has a Next.js app for managing podcast episodes. He wants to charge $9 a month. He cannot rely on Stripe for this: Stripe is invite only in India, and it is not available in Pakistan or Bangladesh. We read Stripe’s global page on 26 November 2026.
- Step 1Create the planA recurring product in the dashboard.
- Step 2InstallOne package and zod.
- Step 3Mount routesCheckout, portal and webhooks.
- Step 4Gate accessRead the customer state.
Install the adapter
The adapter needs Next.js 15 or 16 and the App Router. Use the sandbox while you build. It is a separate environment, so no real money moves.
npm install zod @getruba/nextjsSend buyers to checkout
Export Checkout as a GET handler. It creates a session and sends the browser to Ruba’s checkout. Link your pricing button to it. Pass the product ID in a products value, and your own user ID in a customerExternalId value. So the purchase is tied to your user.
// app/checkout/route.ts
import { Checkout } from "@getruba/nextjs";
export const GET = Checkout({
accessToken: process.env.RUBA_ACCESS_TOKEN,
successUrl: process.env.SUCCESS_URL,
server: "sandbox", // remove for production
});For subscriptions, Ruba offers 7, 14 or 30-day trials that save the card without charging it, retries a declined renewal over about 21 days, and gives customers a hosted portal to see invoices, replace a card and cancel.
Let customers manage their plan
The customer portal lets a buyer see invoices and manage the subscription. Resolve the signed-in user to a Ruba customer ID, or use getExternalCustomerId if you own the identifier.
// app/portal/route.ts
import { CustomerPortal } from "@getruba/nextjs";
import type { NextRequest } from "next/server";
export const GET = CustomerPortal({
accessToken: process.env.RUBA_ACCESS_TOKEN,
getCustomerId: async (req: NextRequest) => "<customer id>",
server: "sandbox",
});Then verify webhooks. The adapter checks the signature before it gives you a typed payload. It has callbacks for subscriptions, orders, customers and more.
// app/api/webhook/ruba/route.ts
import { Webhooks } from "@getruba/nextjs";
export const POST = Webhooks({
webhookSecret: process.env.RUBA_WEBHOOK_SECRET!,
onPayload: async (payload) => {
// handle the payload
},
});Decide who gets access
Ruba’s customer state object holds the customer, their active subscriptions, their granted benefits and their meter balances. One API call, or one customer.state_changed webhook event, gives you everything you need.
What to do next
Ruba charges 4% + $0.50 per payment, plus 0.5% on subscriptions, with no monthly fee. Payouts happen when you ask, cost $2 up to $200, then 1%, and start at $10 after the fee. Apply for Ruba early access, then build in the sandbox. Related: adding a free trial and paywalling a feature.
Ruba has a Next.js adapter, so setup is short. No company, no monthly fee: you can begin as yourself. Your early-access rate for your Next.js app is 4% + $0.50 per sale, locked as long as the account stays open and in good standing. If a fee ever turns up that Ruba never told you about, Ruba refunds it and pays you $100. Terms apply. See the early-access deal.
Questions people ask
Which Next.js versions does the adapter support?
The @getruba/nextjs adapter requires Next.js 15 or 16. It mounts checkout, customer portal and webhook routes in the App Router.
Do I need a Stripe account in my code?
No. Your app talks to Ruba, not to Stripe. Ruba is the Merchant of Record, so it takes the payment, handles supported taxes and pays you to your own bank.
How do I test without real money?
Use Ruba’s sandbox. It is a separate environment with its own dashboard, API and checkout. Create a sandbox organization and set server to sandbox in the adapter.
How does my app know a user has paid?
Read the customer state. One call, or one webhook event, returns the customer’s active subscriptions, granted benefits and meter balances. With your own external ID, you can be live quickly.
Can I use another framework?
Ruba has a TypeScript SDK, and there are adapters beyond Next.js. For a static site, a checkout link and an embed also work.
Sources
We check these when we update this guide. Rules can change, so check them yourself before you decide.
- Ruba: use Ruba with Next.jsChecked 26 Nov 2026
- Ruba: read the customer access stateChecked 26 Nov 2026
- Ruba: subscriptionsChecked 26 Nov 2026
- Ruba: TypeScript SDKChecked 26 Nov 2026
- Stripe: global availabilityChecked 26 Nov 2026
- Ruba: pricing and feesChecked 26 Nov 2026