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

Paddle.js wrapper

Install the Paddle.js wrapper to load Paddle.js using a JavaScript package manager, with full TypeScript definitions.

AI summary

Install the Paddle.js wrapper (@paddle/paddle-js) to load Paddle.js using a JavaScript package manager with full TypeScript definitions. Use it in bundled JavaScript or TypeScript projects like Next.js, Remix, Astro, or Vite instead of a <script> tag.

  • • Install with pnpm/yarn/npm and call await initializePaddle({ environment: 'sandbox', token: ... }); sandbox tokens are prefixed test_.
  • • Drop the environment option or set it to production for live; tokens are created in Paddle > Developer tools > Authentication.
  • • The wrapper exposes the same API as Paddle.js itself — refer to the Paddle.js methods and events documentation for full method coverage including Retain.

The Paddle.js wrapper (@paddle/paddle-js) is a typed ES-module wrapper around Paddle.js. Install it using a JavaScript package manager and import initializePaddle directly, with full TypeScript definitions for every method.

Latest: v1.6.4 · 2026-04-21

Use the wrapper when you're working in a bundled JavaScript or TypeScript project, like Next.js, Remix, Astro, Vite, or similar. If you're loading Paddle.js from a <script> tag instead, see Include and initialize Paddle.js.

Install

pnpm
pnpm add @paddle/paddle-js
yarn
yarn add @paddle/paddle-js
npm
npm install @paddle/paddle-js

Initialize

Import initializePaddle and call it with a client-side token. Client-side tokens are created in Paddle > Developer tools > Authentication. Sandbox tokens are prefixed with test_.

TypeScript
import { initializePaddle, type Paddle } from '@paddle/paddle-js';
const paddle: Paddle | undefined = await initializePaddle({
environment: 'sandbox',
token: process.env.NEXT_PUBLIC_PADDLE_CLIENT_TOKEN!,
});

Drop environment, or set it to production, for live accounts.

Full usage

The wrapper exposes the same API as Paddle.js itself. For full documentation of every method and event, see:

Was this page helpful?