Paddle Billing
Search

Load Paddle.js as a module

Load Paddle.js as a module and use TypeScript definitions when working with Paddle.js methods.

What's new?

We released a wrapper that lets you load Paddle.js as a module rather than manually including it.

It lets you use TypeScript definitions when working with Paddle.js methods.

How it works

Paddle.js. is a lightweight JavaScript library that lets you build rich, integrated subscription billing experiences using Paddle Billing and Paddle Retain. You can use Paddle.js to do things like open checkouts and build workflows for updating payment methods.

You can install Paddle.js by manually loading the Paddle.js script in the <head> of pages where you use Paddle Checkout or Paddle Retain, then initializing using the Paddle.Initialize() method.

The new wrapper lets you install Paddle.js using a package manager like npm and Yarn. You can use it to load Paddle.js as a module, then initialize using the initializePaddle function.

It includes TypeScript definitions for Paddle.js methods, so you can use type checking to write more robust code.

Examples

This is a simple React example that shows how to import, initialize, and open a checkout with one item using the Paddle.js wrapper package.

Next steps

You can install using modern JavaScript package managers, like npm and Yarn.

To learn more and install, see: @paddle/paddle-js - npm

Learn more