Skip to contents

If you already have a token (e.g. from a web browser session), you can set it directly without going through a login flow.

Usage

brapi_set_token(con, token)

Arguments

con

A brapi_connection() object.

token

Character. The Bearer token string.

Value

A new brapi_con object with the token populated.

See also

The "Handling Credentials Safely" section of vignette("brapiR2") for how to keep token out of your script, using .Renviron or the keyring package.

Examples

con <- brapi_connection("https://test-server.brapi.org")
con <- brapi_set_token(con, "my_existing_token")