{"id":19622161,"url":"https://github.com/commercetools/connect-product-export-template","last_synced_at":"2025-10-26T10:39:20.874Z","repository":{"id":203267779,"uuid":"670630364","full_name":"commercetools/connect-product-export-template","owner":"commercetools","description":"Toolkit for developing an integration involving Product export from commercetools","archived":false,"fork":false,"pushed_at":"2024-11-06T19:17:12.000Z","size":2267,"stargazers_count":1,"open_issues_count":19,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-20T15:17:56.634Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/commercetools.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-07-25T13:31:46.000Z","updated_at":"2024-08-08T09:20:06.000Z","dependencies_parsed_at":null,"dependency_job_id":"5f7655ae-6094-478c-a432-4222e6c2621f","html_url":"https://github.com/commercetools/connect-product-export-template","commit_stats":null,"previous_names":["commercetools/connect-product-ingestion-template","commercetools/connect-product-export-template"],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/commercetools%2Fconnect-product-export-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/commercetools%2Fconnect-product-export-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/commercetools%2Fconnect-product-export-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/commercetools%2Fconnect-product-export-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/commercetools","download_url":"https://codeload.github.com/commercetools/connect-product-export-template/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251246390,"owners_count":21558762,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-11T11:26:22.616Z","updated_at":"2025-10-26T10:39:15.843Z","avatar_url":"https://github.com/commercetools.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# connect-product-export-template\nThis repository provides a [connect](https://docs.commercetools.com/connect) template for a product export connector for populating a external systems with product data from composable commerce. This boilerplate code acts as a starting point for such integration.\n\nThis template uses the [Product type](https://docs.commercetools.com/api/projects/productTypes),  [Product](https://docs.commercetools.com/api/projects/products), [Store](https://docs.commercetools.com/api/projects/stores),  [Product Selection](https://docs.commercetools.com/api/projects/product-selections) data models from commercetools composable commerce which can be used for querying Store-specific product data to sync into external systems. Template is based on asynchronous [Subscriptions](https://docs.commercetools.com/api/projects/subscriptions) to keep the external systems up to date.\n\n## Template Features\n- NodeJS supported.\n- Uses Express as web server framework.\n- Uses [commercetools SDK](https://docs.commercetools.com/sdk/js-sdk-getting-started) for the commercetools-specific communication.\n- Includes local development utilities in npm commands to build, start, test, lint \u0026 prettify code.\n- Uses JSON formatted logger with log levels\n- Setup sample integration tests with [Jest](https://jestjs.io/) and [supertest](https://github.com/ladjs/supertest#readme)\n\n## Prerequisite\n#### 1. commercetools composable commerce API client\nUsers are expected to create API client responsible for fetching product, store and product selection details from composable commerce project, API client should have enough scope to be able to do so. These API client details are taken as input as an environment variable/ configuration for connect. Details of compsable commerce project can be provided as environment variables (configuration for connect) `CTP_PROJECT_KEY` , `CTP_CLIENT_ID`, `CTP_CLIENT_SECRET`, `CTP_SCOPE`, `CTP_REGION`. For details, please read [Deployment Configuration](./README.md#Deployment Configuration).\n\n#### 2. commercetools composable commerce Data setup\nUsers are expected to create store and link product selection, accordingly linking products to corresponding product selection. The Store detail is taken as input as an environment variable / configuration for connect. Details of store can be provided as environment variables (configuration for connect) `CTP_STORE_KEY`. For details, please read [Deployment Configuration](./README.md#Deployment Configuration).\n\n#### 3. external system\nUsers are expected to create api clients/ keys in external system . Those details are taken as input as an environment variable / configuration for connect. Details of external system can be provided as environment variables (configuration for connect) `SEARCH_PLATFORM_CONFIG`.For details, please read [Deployment Configuration](./README.md#Deployment Configuration).\n\n \n## Getting started\nThe template contains two separated modules :\n- Full Export : Provides a REST-API to users to export all products from specific store of a commercetools project to external system as initial load or for full reindexing whenever needed. \n- Incremental Updater : Receives message from commercetools project once there are product changes in commercetools store. The modified products are then synchronized to the external system.\n\nRegarding the development of both modules, please refer to the following documetations:\n- Development of Full Export\n- Development of Incremental Updater\n\n#### 1. Develop your specific needs \nTo import the [commercetools composable commerce Product Projections](https://docs.commercetools.com/api/projects/productProjections) to external system, users need to extend this connector with the following tasks\n- Data Mapping: Implementaion to transform the product projection objects from commercetools structure to users-desired structure for external system.\n- Data Persistence: Implementation to save/remove product data to the external system using libraries provided by external systems. Please remember that the product data might not be saved into the external system in a single attempt, it should have needed retry and recovery mechanism.\n\n#### 2. Register as connector in commercetools Connect\nFollow guidelines [here](https://docs.commercetools.com/connect/getting-started) to register the connector for public/private use.\n\n\n## Deployment Configuration\nIn order to deploy your customized connector application on commercetools Connect, it needs to be published. For details, please refer to [documentation about commercetools Connect](https://docs.commercetools.com/connect/concepts)\nIn addition, in order to support connect, the search connector template has a folder structure as listed below\n```\n├── full-export\n│   ├── src\n│   ├── test\n│   └── package.json\n├── incremental-updater\n│   ├── src\n│   ├── test\n│   └── package.json\n└── connect.yaml\n```\n\nConnect deployment configuration is specified in `connect.yaml` which is required information needed for publishing of the application. Following is the deployment configuration used by full export and incremental updater modules\n```\ndeployAs:\n  - name: full-export\n    applicationType: service\n    endpoint: /fullSync\n    scripts:\n      postDeploy: npm install\n    configuration:\n      securedConfiguration:\n        - key: CTP_PROJECT_KEY\n          description: commercetools project key\n        - key: CTP_CLIENT_ID\n          description: commercetools client ID\n        - key: CTP_CLIENT_SECRET\n          description: commercetools client secreet\n        - key: CTP_SCOPE\n          description: commercetools client scope\n        - key: CTP_REGION\n          description: Region of commercetools project\n        - key: SEARCH_PLATFORM_CONFIG\n          description: Escaped JSON object including credentails to external platform and other settings\n  - name: incremental-updater\n    applicationType: event\n    endpoint: /deltaSync\n    scripts:\n      postDeploy: npm install \u0026\u0026 npm run connector:post-deploy\n      preUndeploy: npm install \u0026\u0026 npm run connector:pre-undeploy\n    configuration:\n      securedConfiguration:\n        - key: CTP_STORE_KEY\n          description: Unique key of commercetools Store\n        - key: CTP_PROJECT_KEY\n          description: commercetools project key\n        - key: CTP_CLIENT_ID\n          description: commercetools client ID\n        - key: CTP_CLIENT_SECRET\n          description: commercetools client secreet\n        - key: CTP_SCOPE\n          description: commercetools client scope\n        - key: CTP_REGION\n          description: Region of commercetools project\n        - key: SEARCH_PLATFORM_CONFIG\n          description: Escaped JSON object including credentails to external platform and other settings\n```\n\nHere you can see the details about various variables in configuration\n- CTP_PROJECT_KEY: The key of commercetools project.\n- CTP_CLIENT_ID: The client ID of your commercetools user account. It is used in commercetools client to communicate with commercetools platform via SDK.\n- CTP_CLIENT_SECRET: The client secret of commercetools user account. It is used in commercetools client to communicate with commercetools platform via SDK.\n- CTP_SCOPE: The scope constrains the endpoints to which the commercetools client has access, as well as the read/write access right to an endpoint.\n- CTP_REGION: As the commercetools APIs are provided in six different region, it defines the region which your commercetools user account belongs to.\n- SEARCH_PLATFORM_CONFIG: It defines the configurations required by the external system, such as credentials, search index unique identifier, etc.\n  Following is a sample JSON object of this variable.\n  \n    ```\n    {\n        SEARCH_INDEX_CREDENTIAL_ID: xxx,\n        SEARCH_INDEX_CREDENTIAL_SECRET: yyy,\n        SEARCH_INDEX_ID: zzz\n    }\n\n    ```\n  The value of this configuration variable needs to be in escaped JSON format. Hence, based on the sample above, the expected value of this variable becomes\n  ```\n  '{ \"SEARCH_INDEX_CREDENTIAL_ID\": \"xxx\", \"SEARCH_INDEX_CREDENTIAL_SECRET\": \"yyy\", \"SEARCH_INDEX_ID\": \"zzz\" }'\n  ```\n- CTP_STORE_KEY : Only used in incremental updater. It specifies the key of commercetools store so that connector can look up the modified product under the specific store in commercetools platform.\n\n## Recommendations\n#### Implement your own test cases\nWe have provided simple integration test cases with [Jest](https://jestjs.io/) and [supertest](https://github.com/ladjs/supertest#readme). The implementation is under `test` folder in both `full-export` and `incremental-updater` modules. It is recommended to implement further test cases based on your own needs to test your development. \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcommercetools%2Fconnect-product-export-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcommercetools%2Fconnect-product-export-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcommercetools%2Fconnect-product-export-template/lists"}