Configuration Variables are containers that store essential information such as API keys and database credentials, and allow bot developers to easily access and modify them as needed. They provide a central location for configuration settings, which helps developers ensure that the bot functions correctly and stays up-to-date. Configuration variables also provide a level of security by keeping sensitive information separate from the codebase, reducing the risk of data exposure.
Development vs. productionConfiguration values set in the Botpress Studio are strictly for testing your bot in the emulator. They don’t apply to any production deployments of your bot.To set configuration variables for a production bot in deployment, use the configuration variables tab in the dashboard.

Using Configuration Variables

In the Studio, navigate to the Variables menu in Bot Settings. Here, you can add configuration variables. You can create a new key and add the value you’d like to use in your development environment. This value should only be used for testing purposes in the emulator. Save and publish your bot to enable these changes.

Development

Usage

You can use {{env.key}} to retrieve the value of a Configuration Variable Key that you created. You can use env.key to access its value in an Execute Code card, when writing custom code.

Production

Usage

In the Configuration Variables tab of your bot’s dashboard, you can set key values.