For AI agents and LLMs: a structured documentation index is available at /llms.txt. Every page has a Markdown sibling — append .md to any URL.

Skip to content
Docs

next-forge

Production-ready Next.js boilerplate with a pluggable payments package that supports Paddle Billing.

AI summary

Use the next-forge Turborepo template for Next.js with its @repo/payments package swapped in for Paddle Billing using the official Paddle Node.js SDK and Paddle.js wrapper. next-forge is community-maintained, not by Paddle.

  • • Bootstrap with pnpm dlx next-forge@latest init (Node.js 20+), then follow next-forge's Paddle migration guide instead of configuring the default payments processor.
  • • Initialize the server-side client by exporting new Paddle(PADDLE_SECRET_KEY, { environment: PADDLE_ENV }) from packages/payments/index.ts and re-exporting @paddle/paddle-node-sdk.
  • • Open client-side checkouts with the usePaddle() hook from @repo/payments/checkout and call paddle?.Checkout.open({ items: [...] }).

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.

Requirements

  • Node.js 20+

Install

Create a new next-forge project:

pnpm
pnpm dlx next-forge@latest init
yarn
npx next-forge@latest init
npm
npx next-forge@latest init

Then, 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):

TypeScript
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:

TypeScript
'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>
);
}

Was this page helpful?