Buckets:
| import { OAuth2Client } from "../client.js"; | |
| const authorizationEndpoint = "https://accounts.spotify.com/authorize"; | |
| const tokenEndpoint = "https://accounts.spotify.com/api/token"; | |
| export class Spotify { | |
| 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:
- 856 Bytes
- Xet hash:
- 3eef67bae086fcbc72f82fc86022a65828375c0f404c1f7fd190b58522caa9f1
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.