Subscription Widget
The Subscription Widget related methods which return information from the CDN related to your product catalog and the subscription widget.
All requests to the Product CDN are cached. The caller must call the resetCDNCache function to clear it and fetch updated data.
getCDNStoreSettings v1.0.0 Types
Returns the store settings for your store.
- ESM
- UMD
import { getCDNStoreSettings } from '@rechargeapps/storefront-client';
await getCDNStoreSettings();
await recharge.cdn.getCDNStoreSettings();
getCDNWidgetSettings v1.0.0 Types
Returns the widget settings for your store.
- ESM
- UMD
import { getCDNWidgetSettings } from '@rechargeapps/storefront-client';
await getCDNWidgetSettings();
await recharge.cdn.getCDNWidgetSettings();
getCDNProductAndSettings v1.0.0 Types
Returns a product by external product id with the widget and store settings.
- ESM
- UMD
import { getCDNProductAndSettings } from '@rechargeapps/storefront-client';
await getCDNProductAndSettings(externalProductId);
await recharge.cdn.getCDNProductAndSettings(externalProductId);
getCDNProductsAndSettings v1.0.0 Types
Returns all products, store settings, and widget settings for your store.
This call allows you to get all your products and settings together. However if there are too many products and the payload is too large this will return with an error of too many products
requiring you to fetch products one at a time.
- ESM
- UMD
- Alt Response
import { getCDNProductsAndSettings } from '@rechargeapps/storefront-client';
await getCDNProductsAndSettings();
await recharge.cdn.getCDNProductsAndSettings();
try {
const products = await getCDNProductsAndSettings();
catch (e) {
console.log(e); // 'too many products'
}