1. Add environment variables

- Log into the Platform UI.
- Select your integration.
- In the Build section in the left sidebar, click Advanced.
- Add your environment variables, including a key and a value for each.
- Click Add to include additional environment variables, or click the
xicon to remove variables if needed. - Once you’ve completed adding a key and value, click Save.
2. Reference environment variables

Use environment variables in Zapier's API call forms or in custom code
YOUR_KEY with your actual key: {{process.env.YOUR_KEY}}. Zapier then replaces that variable with the value for that key from your Advanced settings, and uses the current value every time, even if you change it later. You can also reference environment variables in custom code if you switch your API call to code mode.
3. Change environment variables

You can change environment variable values, but not the original keys
- Log into the Platform UI.
- Select your integration.
- In the Build section in the left sidebar, click Advanced.
- Edit the text in the Values column with the new variable values. You cannot edit the Key. If you need to change a key and its value, first delete the old key, then add a new one instead.
4. Use environment variables for staging and production versions
Zapier strongly recommends against using a separate integration for staging. Using version control and environment variables instead makes deployment, integration, and user management (for example, migration) much simpler for your integration. It also helps Developer Support establish exactly what you’re working on and identify relevant logs. It is conventional to reserve one version for testing or staging and one version for production, setting the applicable environment variables under Advanced in each. If you want to be able to work with both environments in development in one version, one approach is the following:- Set environment variables for both domains you want to call.
-
Set another environment variable for the domain you want to work with. For example, a key of
ENVFLAGwith the valuestaging.
- Throughout the app, in Code Mode, check the value of the latter variable and conditionally reference the corresponding domain environment variable.
5. Allow users to select an environment
Certain apps need to allow users to select the domain during authentication. To do so, create an input field in the authentication form, allowing the user to pick which domain they want their connection to interact with.

{{bundle.authData.env_url}} throughout the integration to conditionally call the corresponding domain.