How to add subscriptions to a Next.js app without Stripe

Short answer

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.

From zero to a paid plan
  1. Step 1Create the planA recurring product in the dashboard.
  2. Step 2InstallOne package and zod.
  3. Step 3Mount routesCheckout, portal and webhooks.
  4. Step 4Gate accessRead the customer state.
Figure 1Based on Ruba’s Next.js adapter docs. Test everything in the sandbox first.

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.

Terminal
npm install zod @getruba/nextjs
Figure 2From Ruba’s docs.

Send 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
// 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
});
Figure 3Adapted from Ruba’s docs. Use your own environment variables, and remove server: sandbox when you go live.

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
// 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",
});
Figure 4From Ruba’s docs. Replace the placeholder with your own lookup.

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
// 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
  },
});
Figure 5From Ruba’s docs.

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.

Ruba tells you
Which subscriptions are active
Which benefits are granted
Current meter balances
Your app decides
What a free user can open
What happens when a card fails
Which features need which plan
Figure 6From Ruba’s docs. Your app decides what to lock.

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.

A note from FaizanHi, I’m Faizan, the founder of Ruba. I built it so people anywhere, from Pakistan, India and Bangladesh to the UK, the EU and the US, can sell software to the world and get paid at home.I wrote these guides to be as fair as I can. But I built Ruba, so I’m about as neutral as a parent at a school play. That’s why every fact has a source you can check.
Early access is live.

Sellers approved now keep 4% + $0.50 per sale locked for as long as they sell, plus +$100 if we ever charge a fee we never told you about. No company and no monthly fee. You are paid to a bank in your own name, in PKR, INR, BDT or 51 other currencies, whenever you ask, from $10. A payout costs $2 up to $200.

Applying is not approval. Terms apply.
All guides

Can’t find your country or currency? Email support@getruba.com.

This guide is general information, not legal, tax or financial advice. Other companies named here set their own rules, which can change. Check their websites before you decide.