Community Plugin
View plugin on GitHubThis plugin is used to source product data from builder.io and the checkout API.
How To publish:
npm publish --access=public
How this works:
On build:
- query all the productData pages that exist
- merge the checkout API data with the builder data to generate a
productSelectorData
node with the following shape:
{
id: data.title,
useInProduction: data.useInProduction,
thumbnailImage: data.thumbnailImage,
url: data.url,
productSelector: {
onetime: {
products: [],
discounts: [],
bumpOffers: []
},
subscription: {
products: [],
discounts: [],
bumpOffers: []
}
}
}
Improvement opportunities:
- update the backend to get all prices by one request for all variants. It can make the plugin much faster