How can I access to an environment variable in Javascript?
Gauthier Garnier
I would like to insert my Hotjar Identifier only on certain environments. How can I do that?
0
Comments
Add the variable using the CLI
You can add an environment variable to a specific environment using the Platform.sh CLI.
In your local repository, type the command
platform variable:create. The CLI will then take you through the steps to configure the variable.environment.updates).HOTJARID.HOTJARID, like the string'some-value'.y.env:.n. On the other hand, if you plan on creating children of this branch that will also need access toHOTJARID, chooseyinstead.When you have completed these options, the CLI will create the new variable and redeploy your environment to reflect the changes.
You can also combine these configurations into a single CLI command:
Add the variable using the management console
Alternatively you can go through the same configuration from within the management console:
Settingslink at the top of the page, and then theVariablestab on the sidebar of the next page.Add +button at the top of the page.Add variable.Please sign in to leave a comment.