
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
@unly/serverless-scripts-env
Advanced tools
This plugin aims to answer a specific need and to simplify the assignment of environment variables with serverless either front-end or back-end.
Install the plugin using either Yarn or NPM. (we use Yarn)
NPM:
npm install @unly/serverless-scripts-env
YARN:
yarn add @unly/serverless-scripts-env
The plugin determines your environment during deployment and adds all environment variables to your Lambda function. All you need to do is to load the plugin:
Must be declared before
serverless-webpack, despite what their officially doc says
plugins:
- '@unly/serverless-scripts-env' # Must be first, even before "serverless-webpack", see https://github.com/UnlyEd/serverless-scripts-env
- serverless-webpack # Must be second, see https://github.com/99xt/serverless-dynamodb-local#using-with-serverless-offline-and-serverless-webpack-plugin
serverless.ymlSet the slsScripts object configuration as follows (list of all available options below):
custom:
slsScripts:
offline:
logName: client # name of the command that appears in the terminal being executed
script:
cmd: next # command to execute
args:
- -p 3001
path: # Absolute path to run the command by default take root folder
env:
exclude: # list of environment variables present that will not be provided at launch time in the child process
- SECRET_KEY
provider:
name: aws
runtime: nodejs6.10
environment:
GROUP_NAME: staging
SECRET_KEY: f08ed2dc-edeb-45f4-9cac-56012820a384
slsScripts object:| Attributes | Type | Required | Description |
|---|---|---|---|
| offline | Object | false | script to run before cli serverless-offline start |
| build | Object | false | script to run before cli serverless deploy or serverless package |
offline & build object:| Attributes | Type | Required | Default | Description |
|---|---|---|---|---|
| logName | String | false | Serverless-scripts-env | name of the command that appears in the terminal being executed |
| script | Object | true | ||
| path | String | false | current working directory | Absolute Path to run the script |
| env | Object | false |
script object :| Attributes | Type | Required | Default | Description |
|---|---|---|---|---|
| cmd | String | true | command to execute | |
| args | Array of String | false | [ ] | command arguments to execute |
env object :| Attributes | Type | Required | Default | Description |
|---|---|---|---|---|
| exclude | Array of String | false | environment variables to blacklist |
To test this plugin, you can clone this repository.
Go to examples/, and follow the README.
We gladly accept PRs, but please open an issue first so we can discuss it beforehand.
yarn start # Shortcut - Runs linter + tests in concurrent mode (watch mode)
OR run each process separately for finer control
yarn lint
yarn test
yarn test # Run all tests, interactive and watch mode
yarn test:once
yarn test:coverage
yarn releaseAndPublish # Shortcut - Will prompt for bump version, commit, create git tag, push commit/tag and publish to NPM
yarn release # Will prompt for bump version, commit, create git tag, push commit/tag
npm publish # Will publish to NPM
This plugin officially supports Node.js 6.10 and 8.10.
MIT
FAQs
plugin serverless to help process.env with nextjs
The npm package @unly/serverless-scripts-env receives a total of 4 weekly downloads. As such, @unly/serverless-scripts-env popularity was classified as not popular.
We found that @unly/serverless-scripts-env demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.