Just launched
We're actively working on new content and improvements to our documentation. We'd love to hear your thoughts, launch quick survey
Paddle Billing
Search

Paddle.Setup()

Initializes Paddle.js and Retain.

Use Paddle.Setup() to initialize Paddle.js and set default checkout settings. This is a required method, letting you:

  • Set your Paddle seller ID
  • Integrate with Retain
  • Set settings that apply to all checkouts opened on a page
  • Create event callbacks

You must call Paddle.Setup() and pass your seller ID to use Paddle Checkout. You can find your seller ID in Paddle > Developer Tools > Authentication.

You can pass settings for opened checkouts using either Paddle.Checkout.open() or Paddle.Setup(). Settings passed to Paddle.Setup() are default settings, applied to all checkouts opened on a page.

Paddle.js emits events for key actions as a customer moves through checkout. You can pass an eventCallback to Paddle.Setup() to call a function for every Paddle.js checkout event. This is typically used as part of an inline checkout integration for updating on-page elements, like items lists or breadcrumbs.

Retain

Paddle.js integrates with Retain, so you don't have to embed a separate Retain script in your app or website. Pass pwAuth and your Retain API key to initialize Retain. You can find your Retain API key in ProfitWell > Account Settings > Integrations > API keys/Dev Kit.

To use Retain Notifications, pass pwCustomer for logged-in customers, too. You can use either a Paddle ID of a customer entity or an email address.

See: Retain x Paddle.js

Parameters

sellerinteger

Seller ID for your Paddle account. You can find your seller ID in Paddle > Developer Tools. Required.

pwAuthstring or null

Retain API key. Required if using Retain. You can find your key in ProfitWell > Account Settings > Integrations > API keys/Dev Kit.

pwCustomerobject or null

Identifier for a logged-in customer for Retain Notifications. Pass either id or email, or an empty object if you don't have a logged-in customer.

idstring or null

Paddle ID for a customer entity in Paddle. Do not pass a subscription ID.

emailstring<email> or null

Email address related to a customer entity in Paddle.

checkoutobject or null

Set general checkout settings. Settings here apply to all checkouts opened on the page.

settingsobject
eventCallback(event: EventData) => void or null

Function to call for Paddle.js events.

Examples

Related pages