Docs

Authenticate with Paddle Retain using client-side tokens

Paddle Retain now supports using the same client-side tokens as Paddle Billing for authentication. There's no need to pass a Retain API key anymore.

Tooling

  • Paddle.js
  • Retain
  • Platform

Released

February 14, 2024

Status

Released

What's new?

We updated Paddle Retain so that now you can authenticate using the same client-side tokens that you use to authenticate with Paddle Billing.

token string

Client-side token for authentication. You can create and manage client-side tokens in Paddle > Developer tools > Authentication. Required

This supersedes the pwAuth parameter that was used to authenticate with Paddle Retain previously.

How it works

Client-side tokens let you authenticate with Paddle Billing in your frontend. When working with Paddle.js, you pass a client-side token to Paddle.Initialize() to initialize.

Previously, you had to grab a Retain API key and pass an additional pwAuth parameter to Paddle.Initialize() to authenticate with Paddle Retain.

We updated Paddle Retain so that now it works using the same client-side tokens as Paddle Billing. Passing a client-side token to Paddle.Initialize() where your Paddle Billing account is linked to a Paddle Retain account authenticates you with both Billing and Retain.

This means that going live with Paddle Billing with Retain is easier than ever — just swap your sandbox client-side token with a live one and remove Paddle.Environment.set() if you passed it. Provided you've configured Retain for your account, you're ready to go!

Existing integrations that use pwAuth will continue to work. We recommend that you remove the pwAuth parameter when you're next reviewing your code.

Examples

This example shows how you include and initialize Paddle.js with Retain.

Before

Using pwAuth
<script src="https://cdn.paddle.com/paddle/v2/paddle.js"></script>
<script type="text/javascript">
Paddle.Initialize({
token: 'live_7d279f61a3499fed520f7cd8c08',
pwAuth: '00000000000000000000000000000000',
pwCustomer: { }
});
</script>

After

Using a client-side token
<script src="https://cdn.paddle.com/paddle/v2/paddle.js"></script>
<script type="text/javascript">
Paddle.Initialize({
token: 'live_7d279f61a3499fed520f7cd8c08',
pwCustomer: { }
});
</script>

Next steps

This change is live now, so you can start using a client-side token to authenticate with Paddle Retain.

You don't need to do anything to get the latest version of Paddle.js — we serve the latest version automatically.

Summary of changes

Entity Field Change Type
Paddle.Initialize() token ~ Updated Paddle.js param
Now used for Retain authentication; replaces pwAuth.

Was this page helpful?