trakt_credentials | R Documentation |
trakt_credentials
searches for your credentials and stores them
in the appropriate environment variables of the same name.
To make this work automatically, place your key as environment variables in
~/.Renviron
(see Details
).
Arguments to this function take precedence over any configuration file.
trakt_credentials(username, client_id, client_secret, silent = TRUE)
username |
|
client_id |
|
client_secret |
|
silent |
|
This function is called automatically when the package is loaded via library(tRakt)
or tRakt::fun
function calls – you basically never have to use it if you have
stored your credentials as advised.
Additionally, for regular (non-authenticated) API interaction, you do not have to
set any credentials at all because the package's client_secret
is used as a fallback,
which allows you to use most functions out of the box.
Set appropriate values in your ~/.Renviron
like this:
# tRakt trakt_username=jemus42 trakt_client_id=12[...]f2 trakt_client_secret=f23[...]2nkjb
If (and only if) the environment option trakt_client_secret
is set to a non-empty
string (i.e. it's not ""
), then all requests will be made using authentication.
Invisibly: A list
with elements username
, client_id
and client_secret
,
where values are TRUE
if the corresponding value is non-empty.
Other API-basics:
trakt_get()
,
trakt_get_token()
## Not run:
# Use a values set in ~/.Renviron in an R session:
# (This is automatically executed when calling library(tRakt))
trakt_credentials(silent = FALSE)
# Explicitly set values in an R session, overriding .Renviron values
trakt_credentials(
username = "jemus42",
client_id = "totallylegitclientsecret",
silent = FALSE
)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.