Tumblr
For usage, see OAuth 2.0 provider.
import { Tumblr } from "arctic";
const tumblr = new Tumblr(clientId, clientSecret, redirectURI);
const url: URL = await tumblr.createAuthorizationURL(state);
const tokens: TumblrTokens = await tumblr.validateAuthorizationCode(code);
Get user profile
Use the /user/info
endpoint.
const tokens = await tumblr.validateAuthorizationCode(code);
const response = await fetch("https://api.tumblr.com/v2/user/info", {
headers: {
Authorization: `Bearer ${tokens.accessToken}`
}
});
const user = await response.json();