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
Seller ID for your Paddle account. You can find your seller ID in Paddle > Developer Tools. Required.
Retain API key. Required if using Retain. You can find your key in ProfitWell > Account Settings > Integrations > API keys/Dev Kit.
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.
Paddle ID for a customer entity in Paddle. Do not pass a subscription ID.
Email address related to a customer entity in Paddle.
Set general checkout settings. Settings here apply to all checkouts opened on the page.
Function to call for Paddle.js events.
Examples
This example passes a seller ID to Paddle.js. This is required for integrating a checkout.
You can find your seller ID in Paddle > Developer Tools > Authentication.
1231Paddle.Setup({
2 seller: 99999
3});
This example passes the required fields for initializing Paddle.js and integrating with Retain.
You must pass both seller
and pwAuth
, where:
seller
is the seller ID of your Paddle accountpwAuth
is your Retain API key
You can find your Paddle seller ID in Paddle > Developer Tools > Authentication.
You can find your Retain API key in ProfitWell > Account Settings > Integrations > API keys/Dev Kit.
12341Paddle.Setup({
2 seller: 99999,
3 pwAuth: '00000000000000000000000000000000'
4});
This example sets default checkout settings for all checkouts opened on a page. It includes common settings for inline
checkouts.
12345678910111213141Paddle.Setup({
2 seller: 99999, // replace with your Paddle seller ID
3 pwAuth: '00000000000000000000000000000000', // replace with your Retain API key
4 checkout: {
5 settings: {
6 displayMode: "inline",
7 theme: "light",
8 locale: "en",
9 frameTarget: "checkout-container",
10 frameInitialHeight: "450",
11 frameStyle: "width: 100%; min-width: 312px; background-color: transparent; border: none;"
12 }
13 }
14});
This example sets default checkout settings for all checkouts opened on a page. It includes common settings for overlay
checkouts.
12345678910111Paddle.Setup({
2 seller: 99999,
3 pwAuth: '00000000000000000000000000000000',
4 checkout: {
5 settings: {
6 displayMode: "overlay",
7 theme: "light",
8 locale: "en"
9 }
10 }
11});
This example logs events emitted by Paddle.js to console.
12345671Paddle.Setup({
2 seller: 99999,
3 pwAuth: '00000000000000000000000000000000',
4 eventCallback: function(data) {
5 console.log(data);
6 }
7});
See: Paddle.js events
For logged-in users, you should pass pwCustomer
. This powers Retain Notifications.
This example passes the Paddle ID for a customer entity in Paddle to Retain.
12345671Paddle.Setup({
2 seller: 99999,
3 pwAuth: '00000000000000000000000000000000',
4 pwCustomer: {
5 id: 'ctm_01gt25aq4b2zcfw12szwtjrbdt'
6 }
7});
For logged-in users, you should pass pwCustomer
. This powers Retain Notifications.
This example passes the email address of a customer entity in Paddle to Retain.
12345671Paddle.Setup({
2 seller: 99999,
3 pwAuth: '00000000000000000000000000000000',
4 pwCustomer: {
5 email: 'weloveyourproduct@paddle.com'
6 }
7});