Last updatedNov 18, 2019

Environments

When creating your app, we also create three environments for you: development, staging, and production. Environments are where you deploy your app. You then install the app in an environment onto an Atlassian site to use it.

We recommend using the development environment for testing your changes, staging for a stable version of your app, and production as the version of your app that’s ready for use. For the rest of this tutorial you’ll only use the development environment.

By default, the CLI will run commands for the development environment unless you specify another with the --environment flag.

Environment variables

Environment variables are key-value pairs you can set in each of your app environments (development, staging, production).

  • List your environment variables by running:
    1
    forge variables:list
  • Set a variable with key my-key and value my-value by running:
    1
    forge variables:set my-key my-value
    You can choose to encrypt the value. An encrypted value will not be shown when you list the variables.
  • Unset a variable with key my-key by running:
    1
    forge variables:unset my-key
  • Read a variable with key my-key in your code as below:
    1
    process.env.my-key

Note, when tunneling you will need to set your environment variables locally with a prefix of FORGE_USER_VAR_.