TwurpleAuthenticationGetting dataExamplesFAQMigration

ChatClientOptions

Options for a chat client.

{
The intents to use to query the auth provider.
authIntents?: string[]
The authentication provider to use for getting the chat credentials.
Your bot level, i.e. whether you're a known or verified bot.
botLevel?:
TwitchBotLevel

A Twitch bot level, i.e. whether you're connecting as a known or verified bot.

Aliased type: "none" | "known" | "verified"

Channels to join after connecting.
channels?: ResolvableValue<string[]>
The connection options for a WebSocket connection.
connectionOptions?: WebSocketConnectionOptions
Custom hostname for connecting to chat.
hostName?: string
Whether you're guaranteed to be a mod in all joined channels.
isAlwaysMod?: boolean
Whether to request a token with the old chat permission scope.
legacyScopes?: boolean
Options to pass to the logger.
logger?: Partial<LoggerOptions>
Whether to request a token with only read permission.
readOnly?: boolean
Whether to rejoin the channels the client had joined when a reconnect occurs.
Whether to receive JOIN and PART messages from Twitch chat.
Whether to connect securely using SSL.
ssl?: boolean
Whether to use a WebSocket to connect to chat.
webSocket?: boolean
}

Properties

authIntents

Type: ?string[]

The intents to use to query the auth provider.

The "chat" intent will always be queried last, after the ones you give here.

authProvider

Type: ?AuthProvider

The authentication provider to use for getting the chat credentials.

If you don't pass this, the chat client will connect anonymously.

botLevel

Type:
TwitchBotLevel

A Twitch bot level, i.e. whether you're connecting as a known or verified bot.

Aliased type: "none" | "known" | "verified"

Your bot level, i.e. whether you're a known or verified bot.

This defaults to 'none', which limits your messages to the standard rate limit.

channels

Type: ?ResolvableValue<string[]>

Channels to join after connecting.

May also be a function (sync or async) that returns a list of channels.

connectionOptions

Type: ?WebSocketConnectionOptions

The connection options for a WebSocket connection.

If not using WebSockets, this is ignored.

hostName

Type: ?string

Custom hostname for connecting to chat.

isAlwaysMod

Type: ?boolean

Whether you're guaranteed to be a mod in all joined channels.

This raises the rate limit and lifts the one-second-between-messages rule, but if your bot is not a mod in one of the channels, it subjects you to messages possibly silently not being delivered and your bot possibly getting banned.

legacyScopes

Type: ?boolean

Whether to request a token with the old chat permission scope.

If you're not sure whether this is necessary, just try leaving this off, and if it doesn't work, turn it on and try again.

logger

Type: ?Partial<LoggerOptions>

Options to pass to the logger.

readOnly

Type: ?boolean

Whether to request a token with only read permission.

Ignored if legacyScopes is true.

rejoinChannelsOnReconnect

Type: ?boolean

Whether to rejoin the channels the client had joined when a reconnect occurs.

This means that the channels option will only be resolved on the initial connection.

requestMembershipEvents

Type: ?boolean

Whether to receive JOIN and PART messages from Twitch chat.

ssl

Type: ?boolean

Whether to connect securely using SSL.

You should not disable this except for debugging purposes.

webSocket

Type: ?boolean

Whether to use a WebSocket to connect to chat.