{"id":19622207,"url":"https://github.com/commercetools/serverless-commercetools-plugin","last_synced_at":"2025-04-28T03:32:32.008Z","repository":{"id":39973154,"uuid":"292867542","full_name":"commercetools/serverless-commercetools-plugin","owner":"commercetools","description":"Serverless framework plugin that registers the deployed function as an API Extension or attaches it to a subscription.","archived":false,"fork":false,"pushed_at":"2023-04-21T15:37:32.000Z","size":11189,"stargazers_count":6,"open_issues_count":18,"forks_count":2,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-04-20T15:17:59.486Z","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":"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":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-09-04T14:24:31.000Z","updated_at":"2024-05-02T20:41:07.000Z","dependencies_parsed_at":"2024-11-11T11:42:28.456Z","dependency_job_id":null,"html_url":"https://github.com/commercetools/serverless-commercetools-plugin","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/commercetools%2Fserverless-commercetools-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/commercetools%2Fserverless-commercetools-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/commercetools%2Fserverless-commercetools-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/commercetools%2Fserverless-commercetools-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/commercetools","download_url":"https://codeload.github.com/commercetools/serverless-commercetools-plugin/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251246394,"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:38.191Z","updated_at":"2025-04-28T03:32:26.999Z","avatar_url":"https://github.com/commercetools.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# commercetools Serverless Plugin\n\n[commercetools's](https://commercetools.com/) plugin for the [Serverless Framework](https://serverless.com) allows you to seamlessly integrate your serverless functions with commercetools' extensibility options.\n\n## Contents\n\n- [Features](#features)\n- [Install](#install)\n- [Configuration](#configuration)\n  - [API Extension](#api-extension)\n  - [Subscription](#subscription)\n- [Usage](#usage)\n- [Help](#help)\n- [Development](#development)\n- [License](#license)\n\n## Features\n\n- Attach a newly deployed serverless function as a commercetools' API extension.\n- Create a new serverless function to process events from a commercetools' subscription.\n- Supports AWS and GCP\n\n## Install\n\n```sh\nnpm i --save-dev serverless-commercetools-plugin\n# or\nyarn add --dev serverless-commercetools-plugin\n```\n\nAdd the following plugin to your `serverless.yml`:\n\n```yaml\nplugins:\n  - serverless-commercetools-plugin\n```\n\nWith the [serverless CLI](https://www.serverless.com/framework/docs/providers/aws/cli-reference/plugin-install/)\n\n```sh\nserverless plugin install --name serverless-commercetools-plugin\n```\n\n## Configuration\n\nAdd your commercetools' project settings to the serverless.yaml file. Add these values under the provider section:\n\n```yaml\nprovider:\n  environment:\n    CTP_PROJECT_KEY: \"your_key\"\n    CTP_CLIENT_SECRET: \"your_secret\"\n    CTP_CLIENT_ID: \"your_clientid\"\n    CTP_AUTH_URL: \"your_authurl\"\n    CTP_API_URL: \"your_apiUrl\"\n    CTP_SCOPES: \"your_scopes\"\n```\n\n### API Extension\n\nAdd environment vars for the deploy type (\"extension\") and your body configuration for the [Extension](https://docs.commercetools.com/http-api-projects-api-extensions).\n\n```yaml\n    CTP_DEPLOY_TYPE: \"extension\"\n    CTP_POST_BODY: '{\n        \"destination\": {\n          \"type\": \"AWSLambda\",\n          \"accessKey\": \"your_aws_key\",\n          \"accessSecret\": \"your_aws_secret\"\n        },\n        \"triggers\": [{\n          \"resourceTypeId\": \"cart\",\n          \"actions\": [\"Create\", \"Update\"]\n        }]\n    }'\n```\n\n_Note: The Lambda ARN is determined by the plugin. You do not need to include it in the configuration._\n\nNote: Please note that you can set a key on extensions and subscriptions. The key prevents the same extension or subscription from being deployed twice from CI/CD and manually deploys. One can modify the code from this Opensource repo to customize your deploys for setup in CI/CD and multiply runs.\n\n_For Google Cloud Platform functions set the CTP_POST_BODY to use the HTTP destination as outlined in the [commercetools API Extension documentation.](https://docs.commercetools.com/api/projects/api-extensions#http-destination)_\n\n### Subscription\n\nAdd environment vars for the deploy type (\"subscription\") and your body configuration for the [Subscription](https://docs.commercetools.com/http-api-projects-subscriptions).\n\n```yaml\n    CTP_DEPLOY_TYPE: \"extension\"\n    CTP_POST_BODY: '{\n        \"destination\": {\n          \"type\": \"AWSLambda\",\n          \"accessKey\": \"your_aws_key\",\n          \"accessSecret\": \"your_aws_secret\"\n        },\n        \"triggers\": [{\n          \"resourceTypeId\": \"cart\",\n          \"actions\": [\"Create\", \"Update\"]\n        }]\n    }'\n```\n\n## Usage\n\nTo build your cloud resources and configure the commercetools' project run:\n\n```sh\nserverless deploy\n```\n\nTo remove all cloud resources and commercetools' configuration run:\n\n```sh\nserverless remove\n```\n\n## Help\n\nIf you have any issues, please don't hesitate to:\n\n- Use the [documentation](https://docs.commercetools.com).\n- Open an issue in GitHub.\n\nWhen opening a new issue, please provide as much information as possible including:\n\n- Plugin version\n- node version\n- cloud environment\n- A reproducible code example\n\nThe GitHub issues are intended for bug reports and feature requests specifically related to the serverless plugin.\n\n## Development\n\nCreate a local serverless function or copy the code from the examples folder. Add the plugin code to a folder named .serverless_plugins at the root of your serverless project.\n\n## License\n\nReleased as-is under the MIT license. See LICENSE for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcommercetools%2Fserverless-commercetools-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcommercetools%2Fserverless-commercetools-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcommercetools%2Fserverless-commercetools-plugin/lists"}