Skip to main content
addEventSubscription(streamerId, subscriptionType?): Promise<TwitchEventSubResult>
Defined in: twitch.ts:131 Adds a new Twitch subscription.

Parameters

streamerId

string The Twitch ID of the streamer to subscribe to. You can use fetchUsers to get the user information.

subscriptionType?

TwitchEventSubTypes = TwitchEventSubTypes.StreamOnline The type of subscription to add.

Returns

Promise<TwitchEventSubResult> If successful the result of the Twitch subscription, this contains the id that can be stored in a database for reference. Otherwise an HttpError is thrown.

Remarks

This requires process.env.TWITCH_EVENTSUB_CALLBACK and process.env.TWITCH_EVENTSUB_SECRET to be set.