Buckets:
| import { CodeChallengeMethod, OAuth2Client } from "../client.js"; | |
| const authorizationEndpoint = "https://www.etsy.com/oauth/connect"; | |
| const tokenEndpoint = "https://api.etsy.com/v3/public/oauth/token"; | |
| export class Etsy { | |
| client; | |
| // v3: Remove `_ignore` | |
| constructor(clientId, _ignore, redirectURI) { | |
| this.client = new OAuth2Client(clientId, null, 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; | |
| } | |
| } | |
Xet Storage Details
- Size:
- 973 Bytes
- Xet hash:
- a42e736796746b49a0aeea776dae6b5ea53a0fa94fa7e054d713fd72a680cfb7
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.