Authenticate through SMARTER API and returns a valid token. Token is also cached in package in order to be used by other functions. Calling this function another time will return the cached token if is still valid
1 2 3 4
the SMARTER username (or 'SMARTER_API_USERNAME' environment variable)
the SMARTER password (or 'SMARTER_API_PASSWORD' environment variable)
Returns a valid token as a string
In order to not provide your SMARTER credentials within your code, you could
set those values in your environment. You can call
usethis::edit_r_environ() in order to track credentials in your
.Renviron file using the
Key=value syntax, for example:
SMARTER_API_USERNAME=<smarter username> SMARTER_API_PASSWORD=<smarter password>
See Managing R with .Rprofile, .Renviron, Rprofile.site, Renviron.site, rsession.conf, and repos.conf for more information
SMARTER credentials MUST NOT be tracked in your code
1 2 3 4 5 6
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.