# parcel-plugin-envkey

> Envkey Build Plugin for Parcel

Latest version **1.1.0** (published 2019-12-02) · MIT license · 0 weekly downloads

## Install

```sh
npm install parcel-plugin-envkey
pnpm add parcel-plugin-envkey
yarn add parcel-plugin-envkey
bun add parcel-plugin-envkey
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.0 |
| Published | 2019-12-02 |
| First published | 2019-12-02 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 2.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | The Daily Beast |
| Maintainers | dailybeast |
| Keywords | envkey, env, dotenv, parcel |

## Links

- npm: https://www.npmjs.com/package/parcel-plugin-envkey
- npm.io page: https://npm.io/package/parcel-plugin-envkey

## Dependencies (1)

- [envkey](https://npm.io/package/envkey.md) ^1.2.7

## Alternatives

- [replicas-cli](https://npm.io/package/replicas-cli.md) — 3.0K weekly downloads
- [env-contract](https://npm.io/package/env-contract.md) — 133 weekly downloads
- [@openveo/api](https://npm.io/package/@openveo/api.md) — 61 weekly downloads
- [@ryniaubenpm2/cumque-error-reiciendis](https://npm.io/package/@ryniaubenpm2/cumque-error-reiciendis.md) — 54 weekly downloads
- [ts-global-type-extra](https://npm.io/package/ts-global-type-extra.md) — 11 weekly downloads

## Recent versions

- 1.1.0 (latest) — 2019-12-02
- 1.0.0 — 2019-12-02

## README

# parcel-envkey-plugin

[![npm version](https://badge.fury.io/js/parcel-plugin-envkey.svg)](https://badge.fury.io/js/parcel-plugin-envkey)

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:

```bash
├── 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.

```javascript
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.

---
_Source: https://npm.io/package/parcel-plugin-envkey · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
