Nothing Precedes Matter

    gatsby-plugin-env-variables

    2.2.0 • Public • Published

    Gatsby Environment Variables Plugin

    A 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_ 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:

    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.

    Install

    npm i gatsby-plugin-env-variables

    DownloadsWeekly Downloads

    16,011

    Version

    2.2.0

    License

    MIT

    Unpacked Size

    3.51 kB

    Total Files

    4

    Last publish

    Collaborators

    • chadly