SpotifyApiSpotify LogoJS

AuthManager src/managers/Auth.ts#L22

A manager to perform actions regarding the authorization to the web api.


Properties:

token

Methods:

getApiToken getUserToken

constructor(token) src/managers/Auth.ts#L22

No documentation found.

NameTypeDescription
tokenstringYour spotify web api token.

.token

Type:

string

No documentation found.

.getApiToken(clientID, clientSecret) src/managers/Auth.ts#L31

Returns an api token from your spotify application client id and client secret!

await auth.getApiToken('id', 'secert');

Returns:

Promise<string>

Parameters:

NameTypeDescription
clientIDstringYour spotify app's client id.
clientSecretstringYour spotify app's client secret.

.getUserToken(options) src/managers/Auth.ts#L62

Returns a acces token of a spotify user through the authorization process.

await auth.getUserToken({
   clientID: 'id',
   clientSecret: 'secret',
   code: 'code', // If attempting to get user token through authorization
   refreshToken: 'token', // If attempting to refresh token!
   redirectURL: 'url' // Needs to be the same what you have enetered while authorizing the token!
})

Returns:

Promise<UserTokenContext>

Parameters:

NameTypeDescription
optionsGetUserTokenOptionsOptions required to get spotify user token!