Environment variables are key-value pairs configured outside your source code so that each value can change depending on the Environment. Common use cases are for API keys, and URLs or IDs which change per environment, as they can be more easily updated wherever the key is referenced. You can store as many environment variables in Kinde as you want.
- Choose a key name that helps you easily recognize what the variable is for.
- Use descriptive, purpose-indicating names (e.g.,
DATABASE_URL
, API_KEY_STRIPE
).
- Use a consistent case, such as CamelCase, snake_case, kebab-case, etc. We recommend using UPPER_SNAKE_CASE for environment variables as this is a widely adopted convention.
- Mark a variable as sensitive if the value should be kept secret. For example an API key or password.
- Consider adding a prefix for different environments (e.g.,
PROD_
, DEV_
).
- Document the purpose and format of each variable for team reference.
- Go to Settings > Data management > Env variables.
- Select Add environment variable.
- In the dialog that opens, enter the Key and the Value.
- Select if the key is Sensitive.
- Select Save.
You can only update the value of non-sensitive variables. If you need to update a sensitive variable value, you’ll need to delete and then create a new variable.
- Go to Settings > Data management > Env variables. A list of all your variables is shown.
- Select Edit variable in the … three dots menu next to the relevant non-sensitive variable. The Edit variable dialog opens.
- Change the Value. You cannot change the
key
.
- Select Save.
- Go to Settings > Data management > Env variables. A list of all your variables is shown.
- Select Delete variable in the … three dots menu next to the relevant variable. A confirmation window appears.
- Confirm the variable deletion.