Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
@contentful/ecommerce-app-base
Advanced tools
Library to quickly build an app to integrate your e-commerce system of choice with Contentful
@contentful/ecommerce-app-base
is a library that helps you to quickly build an app to integrate your e-commerce system of choice with Contentful. Many e-commerce integrations are very similar, therefore this library provides the boilerplate for your app and you only need to add the code for your specific service.
This library creates an app which can be used in the entry field location to select stock keeping units (sku) from your e-commerce service. The library also provides a configuration screen for an easy customization.
import { setup } from '@contentful/ecommerce-app-base';
setup({
makeCTA: () => 'Select products',
name: 'My SKU App',
logo: 'https://example.com/logo.svg',
color: '#d7f0fa',
description: 'My example SKU App',
parameterDefinitions: [
{
"id": "category",
"type": "Symbol",
"name": "Catehory",
"description": "Product category of our shop",
"required": true
}
],
validateParameters: () => null,
fetchProductPreviews: async (skus) => {
const responess = await Promise.all(
skus.map(sku => fetch(`https://example.com/products/${sku}`))
);
return responses.map(response => response.json());
},
renderDialog: (sdk) => {
const config = sdk.parameters.invocation;
const container = document.createElement('div');
container.innerHTML = `<iframe src="https://example.com/products-search?category=${config.category}" />`;
document.body.appendChild(container);
},
openDialog: async (sdk, currentValue, config) => {
return await sdk.dialogs.openCurrentApp({
parameters: { config, currentValue },
});
},
isDisabled: () => false,
productCardVersion: 'v2'
});
These Contentful apps use @contentful/ecommerce-app-base
. Look at their source code to learn how they utilize this library:
FAQs
Library to quickly build an app to integrate your e-commerce system of choice with Contentful
The npm package @contentful/ecommerce-app-base receives a total of 405 weekly downloads. As such, @contentful/ecommerce-app-base popularity was classified as not popular.
We found that @contentful/ecommerce-app-base demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.