Environment variables
Environment variables are key-value pairs that can be used to customize behavior at runtime.
During development you may use a .Renviron
or .env
file to keep track of secrets. These files should not be deployed alongside your content item. Instead, set environment in the ricochet
UI. Note that environment variables are encrypted at rest and only decrypted before starting an R or Julia process.
To add environment variables navigate to your content item's setting page at https://ricochet.rs/content/{ID}/settings/env
. The Key
is the name of the environment variable. Value
is the value of the environment variable. Press save after adding new environment variables.
The new environment variables will be available to any new processes.
Accessing environment variables
To access environment variables in R, use Sys.getenv("KEY_NAME")
. Or in Julia, access them via the built in dictionary ENV["KEY_NAME"]