View source: R/sfa_set_api_key.R
sfa_set_api_key | R Documentation |
It is highly recommended to set the API key globally as it makes
specifying the api_key
argument of other sfa_*
functions obsolete.
There are two ways to set your API key globally:
Provide the API key directly as a string (api_key = 'YourApiKey'
).
Create a system-wide environment variable containing you API key and
refer to that (env_var = 'YourEnvVar'
). How to create a system-wide
environment variable depends on your operating system.
The second option is recommended because your R scripts won't contain your API key and it is safe to keep your scripts in an open repository like GitHub.
sfa_set_api_key(api_key, env_var)
api_key |
character You API key. Ignored if you specify |
env_var |
character Name of an environment variable holding you API
key, e.g. |
character The API key (invisibly).
## Not run:
# set API key directly
sfa_set_api_key(api_key = 'YourApiKey')
# set API key via environment variable
# (this assumes you already created an environment variable called
# 'SIMFIN_API_KEY' which contains you API key)
sfa_set_api_key(env_var = 'SIMFIN_API_KEY')
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.