Overview
Properties
Methods
You are advised to roll your own auth provider that can handle scope upgrades, or to plan ahead and supply only access tokens that account for all scopes you will ever need.
Constructor
new StaticAuthProvider(clientId, accessToken, scopes, tokenType)
Creates a new auth provider with static credentials.
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
clientId | string | none | The client ID. |
|
accessToken | string | AccessToken | none |
The access token to provide. You need to obtain one using one of the Twitch OAuth flows. |
|
scopes | Array<string> | none |
The scopes the supplied token has. |
|
tokenType |
AuthProviderTokenType
The type of token an auth provider can return - user tokens and app tokens are supported. Aliased type: "user" | "app" |
"user" |
The type of the supplied token. |
Properties
tokenType
Type:
AuthProviderTokenType
The type of token an auth provider can return - user
tokens and app tokens are supported.
Aliased type:
"user"
|
"app"
The type of token an auth provider can return - user tokens and app tokens are supported.
Aliased type: "user" | "app"
The type of token the provider holds.
Methods
getAccessToken(scopes)
asyncRetrieves an access token.
If the current access token does not have the requested scopes, this method throws. This makes supplying an access token with the correct scopes from the beginning necessary.
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
scopes | string | Array<string> | none | The requested scopes. |