EnglishGuides
Sign-in v1.0.0
User authorization, profile, and episode check-in.
Private methods read the token from MYSHOWS_TOKEN_STORE_PATH. If the file is missing, obtain it through OAuth2 first.
$url = $client->oauth()->buildAuthorizeUrl();
// Open $url. After the redirect back to your site, exchange the code:
$client->oauth()->exchangeCode(code: $_GET['code']);
$profile = $client->profile()->get();Token refresh and episode check-in:
$client->oauth()->refresh();
$client->manage()->checkEpisode(episodeId: 42, rating: 8);Episode rating is an integer from 0 to 10. If token refresh fails, the stored token is cleared so a stale key is not sent again.