# gatsby-plugin-env-variables

> Gatsby plugin to allow system environment variables to be made available to client-side scripts

Latest version **2.3.0** (published 2022-12-22) · MIT license · 0 weekly downloads

## Install

```sh
npm install gatsby-plugin-env-variables
pnpm add gatsby-plugin-env-variables
yarn add gatsby-plugin-env-variables
bun add gatsby-plugin-env-variables
```

## 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 | 2.3.0 |
| Published | 2022-12-22 |
| First published | 2019-01-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 3.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 11 |
| Author | Chad Lee |
| Maintainers | chadly |
| Keywords | gatsby, gatsby-plugin, environment variables, env variables |

## Links

- npm: https://www.npmjs.com/package/gatsby-plugin-env-variables
- Repository: https://github.com/chadly/gatsby-plugin-env-variables
- Homepage: https://github.com/chadly/gatsby-plugin-env-variables#readme
- Issues: https://github.com/chadly/gatsby-plugin-env-variables/issues
- npm.io page: https://npm.io/package/gatsby-plugin-env-variables

## 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

- 2.3.0 (latest) — 2022-12-22
- 2.2.0 — 2021-11-30
- 2.1.0 — 2021-04-12
- 2.0.0 — 2020-07-14
- 1.0.2 — 2020-04-30
- 1.0.1 — 2019-01-23
- 1.0.0 — 2019-01-23

## README

# Gatsby Environment Variables Plugin

> A [Gatsby](https://github.com/gatsbyjs/gatsby) plugin to allow system environment variables to be made available to client-side scripts.

By default, Gatsby only makes system environment variables [prefixed with `GATSBY_`](https://www.gatsbyjs.org/docs/environment-variables/#accessing-environment-variables-in-javascript) available to client scripts. Using this plugin, you can make any arbitrary environment variable available at runtime.

## Install

```
npm install gatsby-plugin-env-variables
```

## How to use

In `gatsby-config.js`:

```js
module.exports = {
  plugins: [
    {
      resolve: `gatsby-plugin-env-variables`,
      options: {
        allowList: ["MY_VAR", "MY_OTHER_VAR"]
      },
    },
  ],
}
```

This will make `MY_VAR` & `MY_OTHER_VAR` available at runtime in your app by accessing `process.env.MY_VAR` or `process.env.MY_OTHER_VAR`.

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