{"id":19622248,"url":"https://github.com/commercetools/commercetools-constructorio-connector","last_synced_at":"2026-05-11T12:35:56.516Z","repository":{"id":145046437,"uuid":"282832953","full_name":"commercetools/commercetools-constructorio-connector","owner":"commercetools","description":null,"archived":false,"fork":false,"pushed_at":"2023-10-16T18:45:33.000Z","size":1577,"stargazers_count":3,"open_issues_count":12,"forks_count":0,"subscribers_count":5,"default_branch":"master","last_synced_at":"2026-02-02T03:58:32.588Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"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":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-07-27T08:04:28.000Z","updated_at":"2024-01-09T19:21:17.000Z","dependencies_parsed_at":null,"dependency_job_id":"ce0ea1f0-3e10-4d5f-9659-a28c318a2764","html_url":"https://github.com/commercetools/commercetools-constructorio-connector","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/commercetools/commercetools-constructorio-connector","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/commercetools%2Fcommercetools-constructorio-connector","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/commercetools%2Fcommercetools-constructorio-connector/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/commercetools%2Fcommercetools-constructorio-connector/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/commercetools%2Fcommercetools-constructorio-connector/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/commercetools","download_url":"https://codeload.github.com/commercetools/commercetools-constructorio-connector/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/commercetools%2Fcommercetools-constructorio-connector/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32894944,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-10T13:40:02.631Z","status":"online","status_checked_at":"2026-05-11T02:00:05.975Z","response_time":120,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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:52.073Z","updated_at":"2026-05-11T12:35:56.488Z","avatar_url":"https://github.com/commercetools.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"constructor.io connector\n====\n\nThis connector contains code to connect commercetools to constructor.io.\n\nIt contains two subscriptions, \u003ccode\u003eproductCreated\u003c/code\u003e and \u003ccode\u003eproductUpdated\u003c/code\u003e, which will update the index on c.io for the updated product but only if it has no staged changes (published).\n\nThere are also two HTTP endpoints, \u003ccode\u003e/api/c.io/exportProduct\u003c/code\u003e, which will export a single CT product to c.io by its ID, and \u003ccode\u003e/api/c.io/export\u003c/code\u003e, which will export the entire catalog.\n\n## Running the app\n\nAfter cloning this repo, run `npm i` to install dependencies.  To run in development mode, use `npm run dev`.\n\n## Configuration\n\nTo read any configuration variables, the app uses this hierarchy:\n\n* Command line arguments\n* Environment variables\n* `config/local.json` (this file is gitignored, therefore safe to keep secrets here)\n* `config/(development|production).json` (depending on the npm run mode)\n* `config/default.json`\n\nSources that are higher up in the hierarchy get priority (e.g., it will use a value from `local.json` before one from `default.json`)\n\nConfiguration variables that are accessed in this code are:\n\n* `port` - this is the node.js port (default: 3001)\n* `pubSub`\n\n    If you look in `config/default.json` you will see the following block:\n   \n    ```\n    \"pubSub\": {\n        \"type\": \"GoogleCloudPubSub\",\n        \"projectId\": \"\u003cgcp_id\u003e\",\n        \"topic\": \"\u003cgcp_pubsub_topic\u003e\"\n    }\n    ```\n\n    You will need to replace \u003cgcp_id\u003e and \u003cgcp_pubsub_topic\u003e with appropriate values for your environment.\n\n* `constructor.io`\n\n    Again in `config/default.json` there is this block:\n\n    ```\n    \"constructor.io\": {\n        \"apiToken\": \"\u003capi_token\u003e\",\n        \"apiKey\": \"\u003capi_key\u003e\",\n        \"mapper\": \"\u003cpath_to_mapper\u003e\"\n    }\n    ```\n\n    `apiToken` and `apiKey` are your constructor.io token and key respectively.  If you want to use a custom mapper (optional), you need to specify the source path in `mapper` (e.g. `services/foo/mapper.js`)\n\n## Mapper behavior\n\nThere is a basic CT -\u003e c.io mapper that lives in `src/services/c.io/baseMapper.js`.  This mapper always gets run.  You can also specify another mapper that will be used in 'pipeline mode' -- so your new mapper will be called with `product` (the CT representation of the product) and with `mapped` (the result of running `product` through the base mapper).\n\nA trivial pipeline mapper would look like this:\n\n```\nmodule.exports = {\n    mapProduct: (product, mapped = {}, languageCode) =\u003e {\n        // maybe do something like change the URL?\n        mapped.url = `https://foo.bar.com/${languageCode}/${product.id}`\n        return mapped\n    }\n}\n```\n\nThe end result of this mapping will have most of its data populated by the base mapper, but customizations can be done if need be.\n\n## Code sharing\n\nSince the subscription listener and the microservice endpoints are defined in the same place, they can share code.  Each entry point into the exporter\n\n* `productCreated`\n* `productUpdated`\n* `/api/c.io/export`\n* `/api/c.io/exportProduct`\n\nuses the same mappers and constructorio connection information.  See `src/services/c.io/index.js` for entry point definitions.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcommercetools%2Fcommercetools-constructorio-connector","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcommercetools%2Fcommercetools-constructorio-connector","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcommercetools%2Fcommercetools-constructorio-connector/lists"}