Install the SDK, create one API route, and embed a pricing widget. Ship recurring payments in under 5 minutes with the App Router.
Start Free# Install
npm install paylio @paylio/react// app/api/subscription/route.ts
import Paylio from "paylio";
const paylio = new Paylio(process.env.PAYLIO_SECRET_KEY!);
export async function GET(req: Request) {
const { searchParams } = new URL(req.url);
const userId = searchParams.get("userId");
const sub = await paylio.getSubscription(userId!);
return Response.json(sub);
}// app/pricing/page.tsx
"use client";
import { PaylioPricingGrid } from "@paylio/react";
export default function PricingPage() {
return (
<PaylioPricingGrid
publishableKey="pk_live_xxx"
userId="user_123"
/>
);
}Add the Paylio Node.js SDK and React component library to your Next.js project with a single install command.
Add a route handler in your App Router that calls Paylio to check a user's subscription status server-side.
Drop the PaylioPricingGrid component into any page. It renders plans, handles checkout, and manages the full billing flow.
Use the subscription response to gate features. Check plan status and entitlements before granting access to premium functionality.
Install the paylio npm package, create an API route that calls paylio.getSubscription(userId) to check status, and embed the @paylio/react PricingGrid component on your pricing page. The entire integration takes under 5 minutes.
Yes. Paylio works with both the App Router and Pages Router. API routes use the standard route.ts convention, and the React component works in client components with the 'use client' directive.
The subscription check API works in Server Components since it is a standard fetch call. The PricingGrid widget requires a client component wrapper because it manages interactive checkout state.
Create a POST route handler at app/api/webhooks/paylio/route.ts. Paylio sends subscription lifecycle events like created, renewed, and canceled. Verify the signature using the SDK helper and update your database accordingly.
Free up to 100 subscribers. No credit card required.
Get Started Free