download
raw
860 Bytes
import { OAuth2Client } from "../client.js";
const authorizationEndpoint = "https://www.reddit.com/api/v1/authorize";
const tokenEndpoint = "https://www.reddit.com/api/v1/access_token";
export class Reddit {
client;
constructor(clientId, clientSecret, redirectURI) {
this.client = new OAuth2Client(clientId, clientSecret, redirectURI);
}
createAuthorizationURL(state, scopes) {
const url = this.client.createAuthorizationURL(authorizationEndpoint, state, scopes);
return url;
}
async validateAuthorizationCode(code) {
const tokens = await this.client.validateAuthorizationCode(tokenEndpoint, code, null);
return tokens;
}
async refreshAccessToken(refreshToken) {
const tokens = await this.client.refreshAccessToken(tokenEndpoint, refreshToken, []);
return tokens;
}
}

Xet Storage Details

Size:
860 Bytes
·
Xet hash:
a0385c07e2d56f41dd3e821a97faa7599521a8b844d70fab2b314055a9659df6

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.