To set a value to an environment variable, use the following syntax:
Using an environment variable for API key:
Once you open a .baml file in VSCode, you should see a small button over every BAML function: Open Playground. Then you should be able to set environment variables in the settings tab.
Or type BAML Playground in the VSCode Command Bar (CMD + Shift + P or CTRL + Shift + P) to open the playground.
To send logs and traces to Boundary Studio, you need to set the BOUNDARY_API_KEY environment variable. This key is provided when you create an API key in your Boundary Studio dashboard.
BAML will do its best to load environment variables from your program. Any of the following strategies for setting env vars are compatible with BAML:
Dockerfilenext.config.jssecrets-store.csi.k8s.io.env file (using dotenv CLI)python-dotenv package in Python or dotenv package in Node.jsErrors for unset environment variables are only thrown when the variable is accessed. If your BAML project has 15 environment variables and 1 is used for the function you are calling, only that one environment variable will be checked for existence.