Skip to contents

Creates a client object that holds connection settings for the mixi2 API. Credentials are read from arguments; if not supplied, they fall back to the environment variables MIXI2_CLIENT_ID, MIXI2_CLIENT_SECRET, MIXI2_TOKEN_URL, and MIXI2_API_ADDRESS.

Usage

mixi2_client(
  client_id = Sys.getenv("MIXI2_CLIENT_ID"),
  client_secret = Sys.getenv("MIXI2_CLIENT_SECRET"),
  token_url = Sys.getenv("MIXI2_TOKEN_URL"),
  api_address = Sys.getenv("MIXI2_API_ADDRESS")
)

Arguments

client_id

OAuth2 client ID. Defaults to Sys.getenv("MIXI2_CLIENT_ID").

client_secret

OAuth2 client secret. Defaults to Sys.getenv("MIXI2_CLIENT_SECRET").

token_url

Token endpoint URL. Defaults to Sys.getenv("MIXI2_TOKEN_URL").

api_address

Base address of the API server (without trailing slash). Defaults to Sys.getenv("MIXI2_API_ADDRESS").

Value

An S3 object of class mixi2_client.

Examples

if (FALSE) { # \dontrun{
client <- mixi2_client(
  client_id     = "my_client_id",
  client_secret = "my_secret",
  token_url     = "https://example.mixi.social/oauth/token",
  api_address   = "https://api.mixi.social"
)
} # }