twitcheasy-twitch-bottwitch-authtwitch-auth-tmitwitch-chat-clienttwitch-eventsubtwitch-pubsub-clienttwitch-webhooks

ClientCredentialsAuthProvider

An auth provider that retrieve tokens using client credentials.

Overview

Constructor

new ClientCredentialsAuthProvider(clientId, clientSecret)

Creates a new auth provider to receive an application token with using the client ID and secret.

ParameterTypeRequiredDefaultDescription
clientIdstringnone

The client ID of your application.

clientSecretstringnone

The client secret of your application.

Properties

tokenType

Type: AuthProviderTokenType

The type of tokens the provider generates.

This auth provider generates app tokens.

clientId

Type: string

The client ID.

currentScopes

Type: Array<string>

The scopes that are currently available using the access token.

Methods

getAccessToken(scopes)

async

Retrieves an access token.

If any scopes are provided, this throws. The client credentials flow does not support scopes.

ParameterTypeRequiredDefaultDescription
scopesstring | Array<string>none

The requested scopes.

Return type: AccessToken

refresh()

async

Retrieves a new app access token.

Return type: AccessToken