next-forge is a production-grade Turborepo template for Next.js apps. Its @repo/payments package is processor-agnostic, with a documented migration path to swap in Paddle Billing using the official Paddle Node.js SDK and Paddle.js wrapper.
next-forge is maintained by the community, not by Paddle. For support, use the next-forge issue tracker.
View source code, report issues, and contribute on GitHub.
Step-by-step guide to swap the default payments processor for Paddle.
Requirements
- Node.js 20+
Install
Create a new next-forge project:
pnpm dlx next-forge@latest initnpx next-forge@latest initnpx next-forge@latest initThen, configure your environment variables, set up required services, and run the development server. See the next-forge documentation for more details.
When setting up your environment variables, don't set up the default payment processor. Instead, follow the Paddle installation guide to configure Paddle.
Quick example
Initialize the server-side client (after running through the migration steps):
import 'server-only';import { Paddle } from '@paddle/paddle-node-sdk';import { keys } from './keys';
const { PADDLE_SECRET_KEY, PADDLE_ENV } = keys();
export const paddle = new Paddle(PADDLE_SECRET_KEY, { environment: PADDLE_ENV,});
export * from '@paddle/paddle-node-sdk';Open a checkout from a client component:
'use client';
import { usePaddle } from '@repo/payments/checkout';
export default function Pricing() { const paddle = usePaddle();
return ( <button onClick={() => paddle?.Checkout.open({ items: [{ priceId: 'pri_01jkzb4x1hc91s8w38cr3m86yy', quantity: 1 }], }) } > Subscribe </button> );}