Overview
Properties
Constructor
new AppTokenAuthProvider(clientId, clientSecret, impliedScopes)
Creates a new auth provider to receive an application token with using the client ID and secret.
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
clientId | string | none | The client ID of your application. | |
clientSecret | string | none | The client secret of your application. | |
impliedScopes | string[] | <complex> | The scopes that are implied for your application, for example an extension that is allowed to access subscriptions. |
Properties
Methods
getAccessTokenForUser(user, scopeSets)
asyncCan only get tokens for implied scopes (i.e. extension subscription support).
The consumer is expected to take care that this is actually set up in the Twitch developer console.
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
user | UserIdResolvable A user ID or a user or channel object. This is not a user name. Please use HelixUserApi#getUserByName to fetch a user object by name. Aliased type: string | number | UserIdResolvableType | none | The user to get an access token for. | |
scopeSets | (?string[])[] | none | The requested scopes. |
getAppAccessToken(forceNew)
asyncFetches an app access token.
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
forceNew | boolean | false | Whether to always get a new token, even if the old one is still deemed valid internally. |