Skip to contents

Stores an authentication token in a process environment variable named "<service>_<name>". The token is never written to disk. If a non-empty variable with that name already exists, the function refuses to overwrite it.

Usage

af_store_token(name, token, service = "apifetch")

Arguments

name

The identifier for this token (e.g. a dataset or resource name).

token

The authentication token (character).

service

A namespace prefix grouping tokens for one API. Default "apifetch".

Value

Invisibly NULL; called for its side effect.

Examples

bdpe <- af_store_token("dengue", "your-token-here", service = "BigDataPE")
#>  Token stored in environment variable: `BigDataPE_dengue`