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

# Paddle.Retain.demo()

Use to demo Retain functionality.

---

Use `Paddle.Retain.demo()` to demo Paddle Retain functionality.

Typically used by typing `Paddle.Retain.demo({feature: 'featureName'})` directly into the browser console. You can simulate payment recovery and dunning, Cancellation Flows, and Term Optimization.

{% callout type="warning" %}
Paddle Retain only works with live data. While you can initialize Paddle.js with Retain in sandbox accounts, Retain features aren't loaded there.
{% /callout %}

{% callout type="info" %}
This method is for Paddle Billing only. If you use Paddle Retain with another billing platform, use the `profitwell` method in the ProfitWell.js snippet instead. To learn more, see [Test Paddle Retain](https://developer.paddle.com/paddle-js/test-retain.md)
{% /callout %}

## Parameters

```yaml
title: Paddle.Retain.demo() parameters
type: object
properties:
  feature:
    type: string
    description: Paddle Retain feature to simulate. Features use sample data.
    enum:
      - cancellationFlow
      - paymentRecovery
      - paymentRecoveryInApp
      - termOptimization
      - termOptimizationInApp
    x-enum-descriptions:
      cancellationFlow:
        description: Demo Retain Cancellation Flows. Simulates a complete cancellation flow.
      paymentRecovery:
        description: >-
          Demo Retain Payment Recovery. Simulates the payment form that a customer sees when they click on a link in a
          payment recovery email. Use sandbox test card details to test a payment.
      paymentRecoveryInApp:
        description: >-
          Demo an in-app notification for Retain Payment Recovery. Simulates an in-app notification that prompts a
          customer to update their payment method.
      termOptimization:
        description: >-
          Demo Retain Term Optimization. Simulates the modal that a customer sees when they click on a link in a Term
          Optimization email.
      termOptimizationInApp:
        description: >-
          Demo an in-app notification for Retain Term Optimization. Simulates an in-app notification that prompts a
          customer to upgrade their plan.
```

## Examples

{% accordion %}

{% accordion-item title="Demo a cancellation flow" %}
This example simulates a cancellation flow. Type this directly into your browser console to demo Retain Cancellation Flows:

```javascript
Paddle.Retain.demo({feature: 'cancellationFlow'})
```

{% /accordion-item %}
{% accordion-item title="Demo payment recovery" %}
This example simulates the payment form that a customer sees when they click on a link in a payment recovery email. Type this directly into your browser console to demo Retain Payment Recovery:

```javascript
Paddle.Retain.demo({feature: 'paymentRecovery'})
```

{% /accordion-item %}

{% accordion-item title="Demo an in-app notification for payment recovery" %}
This example simulates an in-app notification that prompts a customer to update their payment method. Type this directly into your browser console to demo an in-app notification for Retain Payment Recovery:

```javascript
Paddle.Retain.demo({feature: 'paymentRecoveryInApp'})
```

{% /accordion-item %}

{% accordion-item title="Demo term optimization" %}
This example simulates the modal that a customer sees when they click on a link in a Term Optimization email. Type this directly into your browser console to demo Retain Term Optimization:

```javascript
Paddle.Retain.demo({feature: 'termOptimization'})
```

{% /accordion-item %}

{% accordion-item title="Demo an in-app notification for term optimization" %}
This example simulates an in-app notification that prompts a customer to upgrade their plan. Type this directly into your browser console to demo an in-app notification for Retain Term Optimization:

```javascript
Paddle.Retain.demo({feature: 'termOptimizationInApp'})
```

{% /accordion-item %}
{% /accordion %}

To learn more, see [Test Paddle Retain](https://developer.paddle.com/paddle-js/test-retain.md)