read_secret | R Documentation |
This function reads from a local or remote YAML file, as set in the environmental variable "secrets_file"
.
read_secret(property, file = Sys.getenv("secrets_file"))
property |
the property to read, case-sensitive |
file |
either a character string naming a file or a connection open for writing |
In the secrets file, the property name and value have to be separated with a colon (:
), as is intended in YAML files.
The default value for file
is the environmental variable "secrets_file"
.
The file will be read using read_yaml()
, which allows almost any local path or remote connection (such as websites).
# for this example, create a temporary 'secrets' file
my_secrets_file <- tempfile(fileext = ".yaml")
Sys.setenv(secrets_file = my_secrets_file)
writeLines(c("tenant_id: 8fb3c03060e02e89",
"default_users: user_1"),
my_secrets_file)
read_secret("tenant_id")
read_secret("default_users")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.