Skip to content

TwitchProvider

Reference doc for the `TwitchProvider`.

Use this provider to authenticate with Twitch.

import { TwitchProvider } from "@openauthjs/openauth/provider/twitch"
export default issuer({
providers: {
twitch: TwitchProvider({
clientId: "1234567890",
clientSecret: "0987654321"
})
}
})

Methods

TwitchProvider

TwitchProvider(config)

Parameters

Returns Provider

Create a Twitch OAuth2 provider.

TwitchProvider({
clientId: "1234567890",
clientSecret: "0987654321"
})

TwitchConfig

TwitchConfig.clientID

Type string

The client ID.

This is just a string to identify your app.

{
clientID: "my-client"
}

TwitchConfig.clientSecret

Type string

The client secret.

This is a private key that’s used to authenticate your app. It should be kept secret.

{
clientSecret: "0987654321"
}

TwitchConfig.query?

Type Record<string, string>

Any additional parameters that you want to pass to the authorization endpoint.

{
query: {
access_type: "offline",
prompt: "consent"
}
}

TwitchConfig.scopes

Type string[]

A list of OAuth scopes that you want to request.

{
scopes: ["email", "profile"]
}