NSRR Token

nsrr_token(token = NULL)

nsrr_have_token(token = NULL)

nsrr_auth(token = NULL)

nsrr_authenticated(token = NULL)

Arguments

token

Token for NSRR resources. Found at https://sleepdata.org/token

Value

A character vector or NULL

Examples

is.null(nsrr_token())
#> [1] TRUE
if (!is.null(nsrr_token())) {
   res = nsrr_auth()
   res$authenticated
}
bad_res = nsrr_auth("")
bad_res$authenticated
#> [1] FALSE
nsrr_have_token()
#> [1] FALSE
nsrr_authenticated()
#> [1] FALSE