Environment Variables Specific to Gatsby Cloud
The environment variables below allow you to configure features of Gatsby Cloud:
NODE_VERSION: Specify the version of Node.js your project should use. For example,
NODE_VERSION=10. Defaults to
NPM_TOKEN: Use to access private npm modules.
NPM_REGISTRY: Use to set the URL of a private registry.
YARN_FLAGS: Flags that are passed through to the yarn command.
NODE_OPTIONS: Passed through as options for Node.js. For example, -
PREFIX_PATHS: Set to true to enable the
gatsby build. See the docs on prefix-paths.
These variables are pre-defined for both Builds and Preview environments. They are set automatically and cannot be changed. You can reference them in your
gatsby-config.js or anywhere else you would normally reference an environment variable.
BRANCH: The name of the current git branch. Useful for swapping environment variables depending on the branch.
GATSBY_CLOUD: Always true. Useful for checking if your build is running on Gatsby Cloud.
GATSBY_IS_PREVIEW: true only in the CMS Preview environment, for both legacy preview builder and incremental preview builder.
productionfor Production Builds and Pull Request Builds
developmentfor CMS Previews which use the legacy preview builder
productionfor CMS Previews that use the new incremental preview builder
- Regardless of the environment variable value, CMS Preview builds still use preview data
Start building today on Gatsby Cloud!