get_token: Get a trakt.tv API OAuth token

View source: R/api-oauth.R

get_tokenR Documentation

Get a trakt.tv API OAuth token

Description

This is an unfortunately home-brewed version of what should be a simple call to httr2::oauth_flow_device(), but since the <trakt.tv> API plays ever so slightly fast and mildly loose with RFC 8628, that's not possible.

Usage

get_token(cache = TRUE)

Arguments

cache

TRUE: Cache the token to the OS-specific cache directory. See rappdirs::user_cache_dir().

Note

RFC 8628 expects the device token request to have the field "device_code", but the trakt.tv API expects a field named "code". That's it. It's kind of silly.

Examples


get_token()


jemus42/tRakt documentation built on June 13, 2025, 10:18 p.m.