Skip to Content
Next Centra CheckoutcreateCentraProductsCacheServerHelpers

createCentraProductCacheServerHelpers

See source on Github 

Define Centra product cache server helpers. Helpers to be called server-side to retrieve cached data from Centra. To be used in conjunction with createCentraProductCacheClientHelpers

Example

const {fetchProducts, updateProducts} = createGetCentraProductCacheServerHelpers({ cache: { get: (sessionContext, ids) => { // Get products from cache, using ids and the session context (market, pricelist, language). }, set: (sessionContext, products) => { // Insert products to the cache, using the products and the session context (market, pricelist, language) used to retrieve them. }, }, centraCheckout: { url: 'https://acme.centraqa.com/api/checkout/100', secret: 'secret' }, formatProduct: (product) => { // Format the product to your liking. }, getSessionContexts: () => { // Retrieve all the possible session contexts that a user could be using while viewing the product assortment. } })