Sunrise Data
How to create a project with Sunrise Data
Before starting the import, make sure you have access to the Merchant Center. You will also need to run the application in this repository. Check that you meet the requirements and clone this repository to your computer.
1. Create your project
Open the Merchant Center and create an empty project (without sample data).
2. Prepare node environment for Import
Go to the root of this project, where the package.json
is located and install all node dependencies:
npm install
3. Set your commercetools project credentials
-
In the root of the project create a file named
.env
-
Set the
.env
file with your credentials:CTP_PROJECT_KEY = <your project key> CTP_CLIENT_ID = <your client ID> CTP_CLIENT_SECRET = <your client secret> CTP_API_URL = <your apiUrl> (i.e., api.commercetools.com) CTP_AUTH_URL = <your authUrl> (i.e., auth.commercetools.com)
Url variables expect only the host name, not a full URL!
4. Usage
-
Clean all existing project data and import new:
npm run start
-
Clean project data:
npm run clean:data
-
Import project data:
npm run import:data
-
Clean or import certain data (e.g. categories, products, customers, etc.)
npm run clean:categories
or
npm run import:products
Requirements
- Install Node.js (version 10 and up)