Skip to content

This function stores an authentication token for a specific dataset in a system environment variable. The environment variable name is constructed by converting the dataset name to ASCII (removing accents), replacing spaces with underscores, and prefixing it with "BigDataPE_".

Usage

bdpe_store_token(base_name, token, overwrite = FALSE)

Arguments

base_name

The name of the dataset (character).

token

The authentication token for the dataset (character).

overwrite

Replace an existing token for this dataset? Default FALSE.

Value

No return value, called for side effects.

Details

If a variable with that name already exists (and is non-empty), the function will not overwrite it unless overwrite = TRUE (e.g. to replace an expired token).

Examples

bdpe_store_token("education_dataset", "your-token-here")
#> ✔ Token stored in environment variable: `BigDataPE_education_dataset`

# Replace an expired token
bdpe_store_token("education_dataset", "new-token", overwrite = TRUE)
#> ✔ Token stored in environment variable: `BigDataPE_education_dataset`

bdpe_remove_token("education_dataset")
#> ✔ Token removed for "education_dataset" (service "BigDataPE").