download
raw
1.15 kB
import { OAuth2Client, CodeChallengeMethod } from "../client.js";
const authorizationEndpoint = "https://apis.roblox.com/oauth/v1/authorize";
const tokenEndpoint = "https://apis.roblox.com/oauth/v1/token";
const tokenRevocationEndpoint = "https://apis.roblox.com/oauth/v1/token/revoke";
export class Roblox {
client;
constructor(clientId, clientSecret, redirectURI) {
this.client = new OAuth2Client(clientId, clientSecret, redirectURI);
}
createAuthorizationURL(state, codeVerifier, scopes) {
const url = this.client.createAuthorizationURLWithPKCE(authorizationEndpoint, state, CodeChallengeMethod.S256, codeVerifier, scopes);
return url;
}
async validateAuthorizationCode(code, codeVerifier) {
const tokens = await this.client.validateAuthorizationCode(tokenEndpoint, code, codeVerifier);
return tokens;
}
async refreshAccessToken(refreshToken) {
const tokens = await this.client.refreshAccessToken(tokenEndpoint, refreshToken, []);
return tokens;
}
async revokeToken(token) {
await this.client.revokeToken(tokenRevocationEndpoint, token);
}
}

Xet Storage Details

Size:
1.15 kB
·
Xet hash:
5a1c66e8dd7a8d80ee8e0dc9c9fe2424ff0c3d0a94e5a7de3d745ba77350177a

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