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.
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.
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.
Paddle Retain cannot authenticate using the
seller
parameter. You must pass a client-side token toPaddle.Initialize()
usingtoken
.
Examples
Paddle Retain works with live data for your billing platform. This means you can't integrate or test with sandbox accounts.
This example shows how you include and initialize Paddle.js with Retain.
Before
123456781<script src="https://cdn.paddle.com/paddle/v2/paddle.js"></script>
2<script type="text/javascript">
3 Paddle.Initialize({
4 token: 'live_7d279f61a3499fed520f7cd8c08',
5 pwAuth: '00000000000000000000000000000000',
6 pwCustomer: { }
7 });
8</script>
After
123456781<script src="https://cdn.paddle.com/paddle/v2/paddle.js"></script>
2<script type="text/javascript">
3 Paddle.Initialize({
4 token: 'live_7d279f61a3499fed520f7cd8c08',
5
6 pwCustomer: { }
7 });
8</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.