Product

A set of methods to list and retrieve subscription product information based on various criteria like user targeting or entitlements.

list

List all available products, filtered according to user's currency, location, and page language.

Example

const products = window.Pelcro.product.list();

console.log(products);

listByTarget

List all products targeting the current user.

Example

const targetedProducts = window.Pelcro.product.listByTarget();

console.log(targetedProducts);

getById

Get a specific product by id.

Example

const product = window.Pelcro.product.getById(123);

console.log(product);

getByEntitlements

Get products with plans that at least match with one entitlement in the entitlementsArray argument.

Example

window.Pelcro.product.getByEntitlements(["gold", "silver"])