> For the complete documentation index, see [llms.txt](https://developer.paddle.com/llms.txt).

# 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](https://developer.paddle.com/paddlejs/client-side-tokens.md) 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](https://developer.paddle.com/paddlejs/include-paddlejs.md).

Previously, you had to grab a Retain API key and pass an additional `pwAuth` parameter to [`Paddle.Initialize()`](https://developer.paddle.com/paddlejs/methods/paddle-initialize.md) 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](https://developer.paddle.com/build/onboarding/go-live-checklist.md) 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](https://developer.paddle.com/build/retain/set-up-retain-profitwell.md), 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.

{% callout type="warning" %}
Paddle Retain cannot authenticate using the `seller` parameter. You must pass a client-side token to `Paddle.Initialize()` using `token`.
{% /callout %}

## Examples

{% callout type="info" %}
Paddle Retain works with live data for your billing platform. This means you can't integrate or test with [sandbox accounts](https://developer.paddle.com/build/tools/sandbox.md).
{% /callout %}

This example shows how you [include and initialize Paddle.js with Retain](https://developer.paddle.com/paddlejs/include-paddlejs.md).

### Before

```html {% title="Using pwAuth" highlightLines="5" %}
<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

```html {% title="Using a client-side token" highlightLines="4" %}
<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

| Name | Type | Change | Entity | Description |
| --- | --- | --- | --- | --- |
| `token` | Paddle.js param | updated | Paddle.Initialize() | Now used for Retain authentication; replaces pwAuth. |
