New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

parcel-plugin-envkey

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

parcel-plugin-envkey

Envkey Build Plugin for Parcel

  • 1.1.0
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
2
increased by100%
Maintainers
1
Weekly downloads
 
Created
Source

parcel-envkey-plugin

npm version

This package provides the ability to use Envkey safely for apps bundled with Parcel. Because this plugin loads the environment for the purpose of building client-side code a white-list of permitted keys must be specified via an envkey.config.js file - more details below.

Installation

To install the plugin simply install this package and Parcel will take care of calling it at the appropriate time.

npm install --save parcel-envkey-plugin

Configuration

For the plugin to setup the environment correctly it will attempt to load a config file located in the root directory of your project. This config file is a javascript file that exports a configuration object.

For example if your project is setup like:

├── app
│   ├── css
│   ├── images
│   ├── index.html
│   ├── js
│   │   ├── **/*.js
├── .gitignore
├── envkey.config.js <-- you create this file
├── node_modules
├── package.json
└── README.md

Your envkey.config.js file must export an object with a permitted key containing an array of the env vars that are safe to be bundled into a client side app.

module.exports = {
  permitted: [
    'API_HOST',
    'WEBSOCKET_HOST',
    'WWW_DOMAIN'
  ]
}

That's it! Once this file is added to your project Parcel will load and export the correct environment.

Keywords

FAQs

Package last updated on 02 Dec 2019

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc