Unleak

Customer

Set currently logged in customer

Before using any widget, you need to explicitely set the active customer. This should be done right after the snippet injection.
      window.Unleak('customer', {
  id: 'cus_123456789',
  email: '[email protected]',
  currency: 'usd', // optionnal, only if you have multiple currencies
}).then((response) => {
  // Success promise.
}, (error) => {
  // Error promise.
});
    

Params

Name Type Required by Description
id string Manager, Paywall This is the Stripe customer ID (starting with cus_).
email string All widgets Will be used to create a Stripe customer.
currency string Optional Only set if you have multiple currencies in your Stripe account. This will filter plans and products to only show those who use the specified currency.

Success promise

Property Type Description
source string Always CUSTOMER
code string Response status code. Value can be:
OK: Everything went fine.
data object Always null.

Error promise

Property Type Description
source string Always CUSTOMER
code string Response status code. Value can be:
NO_CUSTOMER_EMAIL: You failed to provide the customer email.
data object Always null.