Environment Variables


Environment variables are useful when you like to test your app on different environments or to some key elements used in many components but are prone to change.

To create environment variable, go to project settings > variables

environment variables fouita

You can add some API links here then switch between "prod" and "dev" environments to test your site different links without affecting your users links.

env dev fouita


once you deploy the changes switch back to prod.

Access Env variables

Inside components or any other script you can read the value inside

window.$env.myEnvVar

Note that window.$env has some variables by default, do not override them, they can be useful to your code.

// Access page information
window.$env.page

// Access project owner uid
window.$env.owner_uid

// Access project uid
window.$env.project_uid