Configuration variables
Store essential information like API keys and database credentials.
Configuration Variables are containers that store essential information such as API keys and database credentials, and allow chatbot developers to easily access and modify them as needed. They provide a central location for configuration settings, which helps developers ensure that the chatbot 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. production
Configuration values set in the Botpress Studio are strictly for testing your bot in the emulator. They do not 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 Chatbot settings. Here, you can add configuration variables.
You can create a new key and add the value you'd like to use in yoru development environment. This value should only be used for testing purposes in the emulator.
Save and publish your chatbot 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.
Updated 3 months ago