{"id":21841953,"url":"https://github.com/iopipe/serverless-plugin-iopipe","last_synced_at":"2025-07-08T07:36:21.168Z","repository":{"id":57356774,"uuid":"87950021","full_name":"iopipe/serverless-plugin-iopipe","owner":"iopipe","description":"Automatically wrap your serverless framework functions with IOpipe","archived":false,"fork":false,"pushed_at":"2019-02-13T00:21:43.000Z","size":493,"stargazers_count":40,"open_issues_count":10,"forks_count":8,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-10-16T05:32:01.624Z","etag":null,"topics":["agent","analytics","codemod","jscodeshift","lambda","metrics","nodejs","plugin","serverless","sls","tracing"],"latest_commit_sha":null,"homepage":"https://www.iopipe.com","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/iopipe.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}},"created_at":"2017-04-11T15:24:55.000Z","updated_at":"2023-05-12T16:47:09.000Z","dependencies_parsed_at":"2022-09-26T16:32:03.301Z","dependency_job_id":null,"html_url":"https://github.com/iopipe/serverless-plugin-iopipe","commit_stats":null,"previous_names":[],"tags_count":38,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iopipe%2Fserverless-plugin-iopipe","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iopipe%2Fserverless-plugin-iopipe/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iopipe%2Fserverless-plugin-iopipe/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iopipe%2Fserverless-plugin-iopipe/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iopipe","download_url":"https://codeload.github.com/iopipe/serverless-plugin-iopipe/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248877986,"owners_count":21176239,"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":["agent","analytics","codemod","jscodeshift","lambda","metrics","nodejs","plugin","serverless","sls","tracing"],"created_at":"2024-11-27T22:09:18.636Z","updated_at":"2025-04-14T11:52:01.355Z","avatar_url":"https://github.com/iopipe.png","language":"JavaScript","readme":"# IOpipe Serverless Framework Plugin\n\n[![serverless](http://public.serverless.com/badges/v3.svg)](http://www.serverless.com)\n[![CircleCI](https://circleci.com/gh/iopipe/serverless-plugin-iopipe/tree/master.svg?style=svg\u0026circle-token=3787c8931aea4de4facb5fde25ae456f294f8cc1)](https://circleci.com/gh/iopipe/serverless-plugin-iopipe/tree/master)\n[![styled with prettier](https://img.shields.io/badge/styled_with-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)\n\nA [serverless](http://www.serverless.com) plugin to automatically wrap your functions with [iopipe](https://iopipe.com).\n\n# Requirements\n- Node \u003e= `4.3.2`\n- NPM \u003e= `2.14.12`\n- Serverless \u003e= `1.13.0`\n- Yarn \u003e= `0.22.0` (optional)\n- A valid `package.json` file\n- A valid `serverless.yml` file\n\n# Install\nWith [yarn](https://yarnpkg.com) (recommended) in project directory:\n```\nyarn add @iopipe/iopipe\nyarn add serverless-plugin-iopipe --dev\n```\n\nOR with npm in project directory:\n```\nnpm install @iopipe/iopipe\nnpm install serverless-plugin-iopipe --save-dev\n```\n\nAdd the plugin to your `serverless.yml` file:\n```yaml\nplugins:\n  - serverless-plugin-iopipe\n```\n\nYou'll need to make sure your lambda functions have access to your [IOpipe project token](https://dashboard.iopipe.com/install). The recommended strategy is to use an environment variable. Just setup the variable in serverless.yml like any other.\n\n```yaml\nenvironment:\n  IOPIPE_TOKEN: ${env:IOPIPE_TOKEN}\n```\n\nAlternatively, you can add an [iopipe configuration to your package.json](https://github.com/iopipe/iopipe-js-core#packagejson-configuration).\n\nYou're set! The plugin will run during an `sls deploy` or during `sls invoke local`.\n\nCheck out an [example here](https://github.com/iopipe/serverless-plugin-iopipe/blob/master/example/serverless.yml).\n\n# How Does it Work?\n`serverless-plugin-iopipe` outputs files that import and wrap the function handlers defined in `serverless.yml` with IOpipe so you don't have to. It allows you to deploy and upgrade multiple functions simultaneously.\n\n# Commands\n- `sls iopipe clean` This command cleans up your project folder of extraneous `*-iopipe.js` files if needed. This can be useful when using the [serverless-offline](https://github.com/dherault/serverless-offline) plugin.\n\n# Options\nBeyond the required $IOPIPE_TOKEN environment variable, some options can be set [in the \"custom\" config](https://serverless.com/framework/docs/providers/aws/guide/plugins#installing-plugins) in `serverless.yml`. [See Example](https://github.com/iopipe/serverless-plugin-iopipe/blob/master/example/serverless.yml)\n\n#### `iopipeToken` (optional)\n\nIf not using the environment variable of `$IOPIPE_TOKEN`, the token of the project you would like to wrap your functions with.\n\n#### `iopipeNoVerify` (optional)\n\nSkip a check that ensures iopipe is installed via npm/yarn and present in package.json\n\n#### `iopipeNoUpgrade` (optional)\n\nThe plugin automatically upgrades the IOpipe library to the latest available version that satisfies the semver range specified in package.json. Use this option to disable that feature.\n\n#### `iopipeNoYarn` (optional)\n\nWhen auto-upgrading, Yarn will be used in place of NPM if a yarn.lock file is found. Use this flag disable yarn and use NPM to upgrade the iopipe library.\n\n#### `iopipeExclude` (optional)\n\nExclude certain lambda functions from being wrapped by the plugin. Comma separated string.\n\n#### `iopipeNoStats` (optional)\n\nBy default, the plugin sends _anonymized_, non-identifying usage statistics to Google Analytics. IOpipe will use this info to prioritize updates and enhancements to the plugin. If you'd like to opt out of this, just set this option.\n\n#### `iopipeHandlerDir` (optional)\n\nChange the directory that the IOpipe handler files will be generated in. Defaults to `iopipe_handlers`. Note, watch out using directories beginning with a `.` character due to current bugs within Serverless framework and serverless-offline:\n- [serverless/issues/4633](https://github.com/serverless/serverless/issues/4633)\n- [serverless-offline/pull/346](https://github.com/dherault/serverless-offline/pull/346)\n\n## FAQ\n- Does this work with webpack?\n  - Yes, you can use this plugin with webpack or serverless plugins utilizing webpack. For best results, make sure this plugin is specified _before_ the webpack plugins in serverless.yml, i.e.\n  ```yaml\n  plugins:\n    - serverless-plugin-iopipe\n    - serverless-webpack\n  ```\n- Does this work with [serverless-offline](https://github.com/dherault/serverless-offline)?\n  - Yes, list `serverless-plugin-iopipe` first before any other plugins in `serverless.yml`.\n  - You will likely need to use the `iopipeHandlerDir` option to change where the IOpipe handler files are generated until [this PR is merged](https://github.com/dherault/serverless-offline/pull/346).\n- Can I use IOpipe plugins?\n  - Yes, you can specify iopipe plugins through your [package.json file, or an iopipe.rc file](https://github.com/iopipe/iopipe-js-core#packagejson-configuration). Ensure those plugins are installed into your node_modules folder (yarn or npm).\n\n## Known Issues\n- If you have lambda functions that are already wrapped by iopipe via code, you may experience unexpected results. Remove the iopipe wrapping code from those handlers.\n- If your `package.json` is located in a non-standard place, auto-upgrading may not work.\n- If attempting to use es6 modules natively i.e. `export function handler...`, may not work.\n\n## Support\nFile an issue here, hit us up [on Slack](https://iopipe.now.sh/), or send us a note at [support@iopipe.com](mailto:support@iopipe.com)\n\n## Contributing\n- This project uses [Prettier](https://github.com/prettier/prettier). Please execute `npm run eslintFix` to auto-format the code before submitting pull requests.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiopipe%2Fserverless-plugin-iopipe","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fiopipe%2Fserverless-plugin-iopipe","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiopipe%2Fserverless-plugin-iopipe/lists"}