The Commerce Layer app lets content editors easily link Commerce Layer resources to content data in the Contentful dashboard. Products that are linked from Commerce Layer can be easily previewed via the Contentful web app, making it easier for content editors to use the most recently uploaded products across catalogs and sites.
Commerce Layer is a multi-market commerce API and order management system that lets you add global shopping capabilities to any website, mobile app, chatbot, wearable, voice, or IoT device, with ease. Compose your stack with the best-of-breed tools you already mastered and love. Make any experience shoppable, anywhere, through a blazing-fast, enterprise-grade, and secure API.
The current version of this app allows you to:
Create a Contentful account if you haven't yet and set up a new space for your project.
Create a Commerce Layer account if you haven't already.
If you haven't already, kindly follow this onboarding guide to learn how to set up your Commerce Layer organization and seed with demo data.
In the Commerce Layer dashboard, click on the Integrations tab and create an application with the name: Contentful
and role: Read only
.
Upon successful creation, you will get a CLIENT ID
, CLIENT SECRET
, and BASE ENDPOINT
credentials. Kindly remember to save these, as you'll need them later.
Visit this page and click on the "Install now" button.
Choose where to install the app by selecting a Space and Environment.
You will be redirected to a new page; now click on the "Install" button to proceed.
You will be redirected to a new page; now enter your previously saved Commerce Layer CLIENT ID
, CLIENT SECRET
, and ENDPOINT
credentials to complete the installation.
Now, you can begin using the Commerce Layer contentful app!
Kindly follow the steps below to set up the Commerce Layer contentful app.
Click on the "Content model" tab and add a new content type (e.g., Product or Category).
Add a new Text
field, enter a name (e.g., Product SKU) and select the type Short text, exact search
.
Click on the "Create and configure" button.
Click on the "Appearance" tab, select the Commerce Layer app, select the right resource you want to fetch (either SKUs, SKU Lists, Bundles, or Markets), and click on the "Confirm" button.
Use the same steps above to create all the fields you want, and click on the "Save" button to save the content type.
Create new content to test for each resource based on the created content types.
Search, select, and link the right resource from Commerce Layer to the content field.
Done!
This project was bootstrapped with Create Contentful App and uses Reactjs, Typescript, App SDK, and Forma36 design system. In the project directory, you can perform the following actions using these commands:
npm start
build
folder. It correctly bundles React in production mode and optimizes the build for the best performance.npm run build
npm run upload
npm run upload
, it will upload your app to Contentful and activate it. The only difference is that with this command all required arguments are read from the environment variables. For this command to work, the following environment variables must be set: CONTENTFUL_ORG_ID
- The ID of your organizationCONTENTFUL_APP_DEF_ID
- The ID of the app to which to add the bundleCONTENTFUL_ACCESS_TOKEN
- A personal access tokennpm run upload-ci
To contribute to this project, kindly follow the steps below:
Fork this repository (you can learn how to do this here).
Clone the forked repository like so:
git clone https://github.com/<your username>/commercelayer/contentful-app.git && cd commercelayer/contentful-app
Set your environment with a .env
file using .env.sample
as base.
Install all required packages using the command npm install
.
Run the development server on localhost:3000
using the command npm start
.
Contentful Apps need to run inside the Contentful web app to function properly. Install the app into a space and render your app into one of the available locations.
Create an issue to discuss feature ideas or improvements before working on them.
Make your changes, test them, and create a pull request (learn how to do this).
Someone will attend to your pull request and provide some feedback.
Create an issue in this repository.
Ping us on Twitter.
This repository is published under the MIT license.