Rate this page:
When you call , we automatically create three environments for you:
Environments are where you deploy your app. Once an app is running in an environment, you can install it from that environment on to an Atlassian site with .
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.
By default, the CLI will run commands for the development environment unless you specify another with the flag.
While your app is deployed to development, your app title will have the suffix . Similarly, while your app is deployed to staging, it will have the suffix . Once you deploy your app to production, your app title will no longer have any suffix.
When using the staging environment, you can't use the command. You'll need to redeploy your app using each time you make a code change.
When using the production environment, you can't use the or commands. To debug issues, you’ll need to redeploy your affected code to the staging or development environments where you have access to debugging tools. For apps installed on sites you don’t have access to, you’ll need to ask the app user to download the production logs for your app and send them to you.
Environment variables are key-value pairs you can set in each of your app environments (development, staging, production).
Note, environment variables cannot be accessed in the snapshot context.
List your environment variables by running:
Set a variable with key MY_KEY and value my-value by running:
forge variables:set MY_KEY my-value
Set an encrypted variable by providing the option by running:
forge variables:set --encrypt MY_KEY my-value
Encrypted values are protected from output. However, they are passed to your app's environment as clear text.
Unset a variable with key MY_KEY by running:
forge variables:unset MY_KEY
Read a variable with key MY_KEY in your code as below:
When you're using the command, you must prefix environment variables with .
Set the value of by prefixing to the variable name, then running the following command in your terminal:
You do not need to change variable assignment when using environment variables with , the variable is still accessed with .
const myVar = process.env.MY_KEY // MY_KEY will be "test"
Rate this page: