### Install @twurple/ebs-helper Source: https://twurple.js.org/reference/ebs-helper Install the library using your preferred package manager. ```bash npm install @twurple/ebs-helper ``` ```bash yarn add @twurple/ebs-helper ``` ```bash pnpm install @twurple/ebs-helper ``` -------------------------------- ### Install @twurple/auth Source: https://twurple.js.org/reference/auth Install the library using npm, yarn, or pnpm. ```bash npm install @twurple/auth # or yarn add @twurple/auth # or pnpm install @twurple/auth ``` -------------------------------- ### Use Twurple Auth with TMI.js Source: https://twurple.js.org/reference/auth-tmi Example demonstrating how to initialize a TMI client using an AuthProvider from @twurple/auth. This setup allows for automatic token refreshing and is compatible with other @twurple packages. ```javascript const tmi = require('@twurple/auth-tmi'); const { StaticAuthProvider } = require('@twurple/auth'); const authProvider = new StaticAuthProvider('my-client-id', 'my-bot-token'); const client = new tmi.Client({ options: { debug: true, messagesLogLevel: 'info' }, connection: { reconnect: true, secure: true }, authProvider: authProvider, channels: ['my-channel'] }); client.connect().catch(console.error); client.on('message', (channel, tags, message, self) => { if (self) return; if (message.toLowerCase() === '!hello') { client.say(channel, `@${tags.username}, heya!`); } }); ``` -------------------------------- ### Install @twurple/easy-bot Source: https://twurple.js.org/reference/easy-bot Install the package using npm, yarn, or pnpm. ```bash npm install @twurple/easy-bot ``` ```bash yarn add @twurple/easy-bot ``` ```bash pnpm install @twurple/easy-bot ``` -------------------------------- ### Installation Source: https://twurple.js.org/reference/auth Instructions for installing the @twurple/auth package using common package managers. ```APIDOC ## Installation To install the package, use one of the following commands: ```bash npm install @twurple/auth # or yarn add @twurple/auth # or pnpm install @twurple/auth ``` ``` -------------------------------- ### Install Twurple Chat Client Source: https://twurple.js.org/reference/chat Use these commands to install the required packages via npm, yarn, or pnpm. ```bash npm install @twurple/auth @twurple/chat # or yarn add @twurple/auth @twurple/chat # or pnpm install @twurple/auth @twurple/chat ``` -------------------------------- ### Install Twurple API and Auth packages Source: https://twurple.js.org/reference/api Use these commands to install the necessary dependencies for authentication and API interaction. ```bash npm install @twurple/auth @twurple/api # or yarn add @twurple/auth @twurple/api # or pnpm install @twurple/auth @twurple/api ``` -------------------------------- ### Twurple API Installation Source: https://twurple.js.org/reference/api Instructions on how to install the Twurple API library using npm, yarn, or pnpm. ```APIDOC ## Installation ``` npm install @twurple/auth @twurple/api # or yarn add @twurple/auth @twurple/api # or pnpm install @twurple/auth @twurple/api ``` ``` -------------------------------- ### Install @twurple/auth-tmi Source: https://twurple.js.org/reference/auth-tmi Install the necessary packages for using Twurple authentication with TMI.js. This includes @twurple/auth and @twurple/auth-tmi. ```bash npm install @twurple/auth @twurple/auth-tmi # or yarn add @twurple/auth @twurple/auth-tmi # or pnpm install @twurple/auth @twurple/auth-tmi ``` -------------------------------- ### Twurple JS Example - Accessing HelixEntitlementApi Source: https://twurple.js.org/reference/api/classes/HelixEntitlementApi.html An example demonstrating how to instantiate an ApiClient and access the entitlements methods, specifically `getDropsEntitlements`. ```javascript const api = new ApiClient({ authProvider }); const dropsEntitlements = await api.entitlements.getDropsEntitlements(); ``` -------------------------------- ### Install Twurple EventSub WebSocket dependencies Source: https://twurple.js.org/reference/eventsub-ws Use these commands to install the necessary packages for EventSub WebSocket functionality using npm, yarn, or pnpm. ```bash npm install @twurple/api @twurple/eventsub-ws # or yarn add @twurple/api @twurple/eventsub-ws # or pnpm install @twurple/api @twurple/eventsub-ws ``` -------------------------------- ### Install @twurple/eventsub-http Source: https://twurple.js.org/reference/eventsub-http Install the @twurple/eventsub-http and @twurple/api packages using npm, yarn, or pnpm. These are required for listening to Twitch events via HTTP/WebHooks. ```bash npm install @twurple/api @twurple/eventsub-http ``` ```bash yarn add @twurple/api @twurple/eventsub-http ``` ```bash pnpm install @twurple/api @twurple/eventsub-http ``` -------------------------------- ### POST /raids/start Source: https://twurple.js.org/reference/api/classes/HelixRaidApi.html Starts a raid from one broadcaster to another. ```APIDOC ## POST /raids/start ### Description Starts a raid from the specified broadcaster to the target broadcaster. ### Method POST ### Endpoint api.raids.startRaid(from, to) ### Parameters #### Path Parameters - **from** (UserIdResolvable) - Required - The raiding broadcaster ID. - **to** (UserIdResolvable) - Required - The target broadcaster ID. ### Request Example const raid = await api.raids.startRaid('125328655', '61369223'); ### Response #### Success Response (200) - **void** (void) - Returns nothing upon successful initiation. ``` -------------------------------- ### HelixInstalledExtensionList Methods Source: https://twurple.js.org/reference/api/classes/HelixInstalledExtensionList.html Methods for retrieving installed extensions from a channel. ```APIDOC ## GET HelixInstalledExtensionList.getAllExtensions() ### Description Retrieves a list of all extensions installed in a channel. ### Response #### Success Response (200) - **return** (HelixInstalledExtension[]) - A list of all installed extensions. --- ## GET HelixInstalledExtensionList.getExtensionAtSlot(type, slotId) ### Description Retrieves a specific extension installed at a given slot. ### Parameters #### Path Parameters - **type** (string) - Required - The type of the slot (e.g., "panel", "overlay"). - **slotId** (string) - Required - The ID of the slot (e.g., "1", "2", "3"). ### Response #### Success Response (200) - **return** (HelixInstalledExtension | null) - The extension found at the specified slot, or null if none exists. ``` -------------------------------- ### Lifecycle Control Methods Source: https://twurple.js.org/reference/eventsub-ws/classes/EventSubWsListener.html Methods to start and stop the WebSocket listener. ```APIDOC ## start() ### Description Starts the WebSocket listener. ### Response - **Return type** (void) ## stop() ### Description Stops the WebSocket listener. ### Response - **Return type** (void) ``` -------------------------------- ### GET /goals Source: https://twurple.js.org/reference/api/classes/HelixGoalApi.html Retrieves the creator goals for a specific broadcaster. ```APIDOC ## GET /goals ### Description Retrieves the creator goals for a specific broadcaster. ### Method GET ### Endpoint /goals ### Parameters #### Query Parameters - **broadcaster** (UserIdResolvable) - Required - The ID of the broadcaster. Can be 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. ### Request Example ```json { "broadcaster": "61369223" } ``` ### Response #### Success Response (200) - **data** (HelixGoal[]) - An array of HelixGoal objects representing the broadcaster's goals. #### Response Example ```json { "data": [ { "id": "12345", "title": "Followers Goal", "description": "Reach 1000 followers", "type": "follower", "current_amount": 500, "target_amount": 1000 } ] } ``` ``` -------------------------------- ### GET getExtensionBroadcasterConfiguration Source: https://twurple.js.org/reference/ebs-helper/functions/getExtensionBroadcasterConfiguration.html Fetches the broadcaster configuration of an extension for a specific broadcaster. ```APIDOC ## getExtensionBroadcasterConfiguration ### Description Fetches the broadcaster configuration of an extension for a broadcaster. ### Parameters #### Path Parameters - **broadcaster** (UserIdResolvable) - Required - The broadcaster to fetch the configuration for. Can be a user ID, user object, or channel object. #### Request Body - **config** (EbsCallConfig) - Required - Configuration object for the EBS call. - **config.clientId** (string) - Required - The client ID of the extension. - **config.ownerId** (string) - Required - The user ID of the extension's owner. - **config.secret** (string) - Required - A valid extension secret to sign the JWT with. - **config.ttl** (number) - Optional - The time the JWT should be valid for, in seconds. Defaults to 1 minute (60 seconds). ### Response - **Return Type** (HelixExtensionConfigurationSegment | null) - The broadcaster configuration segment or null if not found. ``` -------------------------------- ### GET /videos/game Source: https://twurple.js.org/reference/api/classes/HelixVideoApi.html Retrieves videos associated with a specific game ID. ```APIDOC ## GET /videos/game ### Description Gets the videos of the given game. ### Parameters #### Query Parameters - **gameId** (string) - Required - The game you want to get videos from. - **filter** (HelixPaginatedVideoFilter) - Optional - Filtering options including after, before, language, limit, orderBy, period, and type. ### Response #### Success Response (200) - **HelixPaginatedResult** - A paginated result containing video data. ``` -------------------------------- ### Get Schedule Source: https://twurple.js.org/reference/api/classes/HelixScheduleApi.html Gets the schedule for a given broadcaster. ```APIDOC ## GET /schedule ### Description Gets the schedule for a given broadcaster. ### Method GET ### Endpoint /schedule ### Parameters #### Query Parameters - **broadcaster** (UserIdResolvable) - Required - The broadcaster to get the schedule of. - **filter** (HelixPaginatedScheduleFilter) - Optional - Filter options for the schedule. - **after** (string) - Optional - A cursor to get the following page of results. - **limit** (number) - Optional - The number of results per page. - **startDate** (string) - Optional - The earliest date to find schedule segments for. - **utcOffset** (number) - Optional - The offset from UTC you request for, to ensure everything goes to the correct day. ### Response #### Success Response (200) - **schedule** (HelixPaginatedScheduleResult) - The paginated schedule result. - **data** (array) - An array of HelixScheduleSegment objects. - **pagination** (object) - Pagination information. - **cursor** (string) - The cursor for the next page of results. #### Response Example ```json { "data": [ { "id": "123e4567-e89b-12d3-a456-426614174000", "title": "My Awesome Stream", "startTime": "2023-10-27T10:00:00.000Z", "endTime": "2023-10-27T14:00:00.000Z", "isRecurring": false, "category": { "id": "33", "name": "Software and Game Development" } } ], "pagination": { "cursor": "someCursor" } } ``` ``` -------------------------------- ### GET /channels Source: https://twurple.js.org/reference/api/classes/HelixChannelApi.html Gets the channel data for the given user. ```APIDOC ## GET /channels ### Description Gets the channel data for the given user. ### Method GET ### Endpoint /channels ### Parameters #### Query Parameters - **user** (UserIdResolvable) - Required - The user you want to get channel info for. ### Response #### Success Response (200) - Returns HelixChannel object or null if not found. ``` -------------------------------- ### Constructor: new ReverseProxyAdapter(options) Source: https://twurple.js.org/reference/eventsub-http/classes/ReverseProxyAdapter.html Initializes a new ReverseProxyAdapter instance to handle incoming WebHook requests via a reverse proxy. ```APIDOC ## Constructor: new ReverseProxyAdapter(options) ### Description Creates a reverse proxy connection adapter for the EventSub HTTP listener. ### Parameters #### Options - **options** (ReverseProxyAdapterConfig) - Required - Configuration object for the adapter. - **options.hostName** (string) - Required - The host name the reverse proxy is available under. - **options.pathPrefix** (string) - Required - The path prefix your reverse proxy redirects to the listener. - **options.port** (number) - Optional - The port the server should listen to (defaults to 8080). - **options.usePathPrefixInHandlers** (boolean) - Optional - Whether the path prefix is passed to the handler (defaults to false). ``` -------------------------------- ### Get Schedule Segments by IDs Source: https://twurple.js.org/reference/api/classes/HelixScheduleApi.html Gets a set of schedule segments by IDs. ```APIDOC ## GET /schedule/segments/batch ### Description Gets a set of schedule segments by IDs. ### Method GET ### Endpoint /schedule/segments/batch ### Parameters #### Query Parameters - **broadcaster** (UserIdResolvable) - Required - The broadcaster to get schedule segments of. - **ids** (string[]) - Required - The IDs of the schedule segments. ### Response #### Success Response (200) - **scheduleSegments** (HelixScheduleSegment[]) - An array of requested schedule segments. #### Response Example ```json { "scheduleSegments": [ { "id": "123e4567-e89b-12d3-a456-426614174000", "title": "My Awesome Stream", "startTime": "2023-10-27T10:00:00.000Z", "endTime": "2023-10-27T14:00:00.000Z", "isRecurring": false, "category": { "id": "33", "name": "Software and Game Development" } } ] } ``` ``` -------------------------------- ### Get Schedule Segment by ID Source: https://twurple.js.org/reference/api/classes/HelixScheduleApi.html Gets a single schedule segment by ID. ```APIDOC ## GET /schedule/segments/{id} ### Description Gets a single schedule segment by ID. ### Method GET ### Endpoint /schedule/segments/{id} ### Parameters #### Path Parameters - **broadcaster** (UserIdResolvable) - Required - The broadcaster to get a schedule segment of. - **id** (string) - Required - The ID of the schedule segment. ### Response #### Success Response (200) - **scheduleSegment** (HelixScheduleSegment | null) - The requested schedule segment, or null if not found. #### Response Example ```json { "scheduleSegment": { "id": "123e4567-e89b-12d3-a456-426614174000", "title": "My Awesome Stream", "startTime": "2023-10-27T10:00:00.000Z", "endTime": "2023-10-27T14:00:00.000Z", "isRecurring": false, "category": { "id": "33", "name": "Software and Game Development" } } } ``` ``` -------------------------------- ### Get Schedule as iCal Source: https://twurple.js.org/reference/api/classes/HelixScheduleApi.html Gets the schedule for a given broadcaster in iCal format. ```APIDOC ## GET /schedule/ical ### Description Gets the schedule for a given broadcaster in iCal format. ### Method GET ### Endpoint /schedule/ical ### Parameters #### Query Parameters - **broadcaster** (UserIdResolvable) - Required - The broadcaster to get the schedule for. ### Response #### Success Response (200) - **icalData** (string) - The schedule data in iCal format. #### Response Example ```ical BEGIN:VCALENDAR VERSION:2.0 PRODID:-//Twurple//Schedule API//EN CALSCALE:GREGORIAN BEGIN:VEVENT DTSTART:20231027T100000Z DTEND:20231027T140000Z SUMMARY:My Awesome Stream UID:123e4567-e89b-12d3-a456-426614174000 END:VEVENT END:VCALENDAR ``` ``` -------------------------------- ### GET /channels (Multiple IDs) Source: https://twurple.js.org/reference/api/classes/HelixChannelApi.html Gets the channel data for the given users. ```APIDOC ## GET /channels (Multiple IDs) ### Description Gets the channel data for the given users. ### Method GET ### Endpoint /channels ### Parameters #### Query Parameters - **users** (UserIdResolvable[]) - Required - The users you want to get channel info for. ### Response #### Success Response (200) - Returns an array of HelixChannel objects. ``` -------------------------------- ### Constructor: new EnvPortAdapter(options) Source: https://twurple.js.org/reference/eventsub-http/classes/EnvPortAdapter.html Creates a new instance of the EnvPortAdapter to handle connection port configuration via environment variables. ```APIDOC ## Constructor: new EnvPortAdapter(options) ### Description Creates a new environment port connection adapter. ### Parameters #### options (EnvPortAdapterConfig) - **hostName** (string) - Optional - The host name the reverse proxy is available under. - **variableName** (string) - Optional - The environment variable name the adapter should get the port from. ``` -------------------------------- ### ApiClient Constructor Source: https://twurple.js.org/reference/api/classes/ApiClient.html Initializes a new ApiClient instance with the provided configuration. ```APIDOC ## new ApiClient(config) ### Description Creates a new API client instance. ### Parameters #### Path Parameters - **config** (ApiConfig) - Required - Configuration for the client instance. ``` -------------------------------- ### startRaid(from, to) Source: https://twurple.js.org/reference/api/classes/HelixRaidApi.html Initiates a raid from one live broadcaster to another. ```APIDOC ## POST /startRaid ### Description Initiate a raid from a live broadcaster to another live broadcaster. ### Method POST ### Endpoint /startRaid ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **from** (UserIdResolvableType | number) - Required - The raiding broadcaster. This is not a user name. Please use HelixUserApi#getUserByName to fetch a user object by name. - **to** (UserIdResolvableType | number) - Required - The raid target. This is not a user name. Please use HelixUserApi#getUserByName to fetch a user object by name. ### Request Example ```json { "from": "12345", "to": "67890" } ``` ### Response #### Success Response (200) - **data** (HelixRaid) - Information about the initiated raid. #### Response Example ```json { "data": { "raids": [ { "fromBroadcasterId": "12345", "fromBroadcasterName": "StreamerA", "fromBroadcasterLogin": "streamer_a", "toBroadcasterId": "67890", "toBroadcasterName": "StreamerB", "toBroadcasterLogin": "streamer_b" } ] } } ``` ``` -------------------------------- ### onChannelGoalBegin Source: https://twurple.js.org/reference/eventsub-ws/classes/EventSubWsListener.html Subscribes to events that represent a Goal beginning. ```APIDOC ## onChannelGoalBegin(user, handler) ### Description Subscribes to events that represent a Goal beginning. ### Parameters - **user** (UserIdResolvable) - Required - The user for which to get notifications about Goals in their channel. - **handler** ((data: EventSubChannelGoalBeginEvent) => void) - Required - The function that will be called for any new notifications. ### Response - **Return type** (EventSubSubscription) - The subscription object. ``` -------------------------------- ### Create a Twurple Easy Bot with Commands Source: https://twurple.js.org/reference/easy-bot Example of creating a bot instance with a static auth provider and defining a custom command for rolling a d20 dice. ```typescript import { Bot, createBotCommand } from '@twurple/easy-bot'; import { StaticAuthProvider } from '@twurple/auth'; const bot = new Bot({ authProvider: new StaticAuthProvider("clientId", "accessToken"), channel: 'satisfiedpear', commands: [ createBotCommand('d20', async (params, { userName, say, timeout }) => { const diceRoll = Math.floor(Math.random() * 20) + 1; if (diceRoll === 1) { await say(`@${userName} rolled a critical failure and must be punished!`); await timeout(30, 'critical failure'); } else if (diceRoll === 20) { await say("Woah, critical success! @${userName} deserves all the praise!"); } else { await say(`@${userName} rolled a ${diceRoll}!`); } }) ] }); ``` -------------------------------- ### ChatClient Constructor Source: https://twurple.js.org/reference/chat/classes/ChatClient.html Initializes a new ChatClient instance with the provided configuration options. ```APIDOC ## new ChatClient(config) ### Description Creates a new Twitch chat client. ### Parameters #### Request Body - **config** (ChatClientOptions) - Required - Description: See below - **authIntents** (string[]) - Optional - Description: The intents to use to query the auth provider. The "chat" intent will always be queried last, after the ones you give here. - **authProvider** (AuthProvider) - Optional - Description: The authentication provider to use for getting the chat credentials. If you don't pass this, the chat client will connect anonymously. - **botLevel** (TwitchBotLevel) - Optional - Default: "none" - Description: 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. Aliased type: "none" | "known" | "verified" - **channels** (ResolvableValue) - Optional - Description: Channels to join after connecting. May also be a function (sync or async) that returns a list of channels. - **connectionOptions** (WebSocketConnectionOptions) - Optional - Description: The connection options for a WebSocket connection. If not using WebSockets, this is ignored. - **hostName** (string) - Optional - Description: Custom hostname for connecting to chat. - **isAlwaysMod** (boolean) - Optional - Description: 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** (boolean) - Optional - Description: 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** (Partial) - Optional - Description: Options to pass to the logger. - **readOnly** (boolean) - Optional - Description: Whether to request a token with only read permission. Ignored if `legacyScopes` is `true`. - **rejoinChannelsOnReconnect** (boolean) - Optional - Description: 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** (boolean) - Optional - Description: Whether to receive JOIN and PART messages from Twitch chat. - **ssl** (boolean) - Optional - Default: true - Description: Whether to connect securely using SSL. You should not disable this except for debugging purposes. - **webSocket** (boolean) - Optional - Description: Whether to use a WebSocket to connect to chat. ``` -------------------------------- ### GET /channels (Batched) Source: https://twurple.js.org/reference/api/classes/HelixChannelApi.html Gets the channel data for the given user, batching multiple calls into fewer requests as the API allows. ```APIDOC ## GET /channels (Batched) ### Description Gets the channel data for the given user, batching multiple calls into fewer requests as the API allows. ### Method GET ### Endpoint /channels ### Parameters #### Query Parameters - **user** (UserIdResolvable) - Required - The user you want to get channel info for. ### Response #### Success Response (200) - Returns HelixChannel object or null if not found. ``` -------------------------------- ### GET /channels/followers Source: https://twurple.js.org/reference/api/classes/HelixChannelApi.html Gets a list of users that follow the specified broadcaster. This can also be used to check if a specific user follows the broadcaster. ```APIDOC ## GET /channels/followers ### Description Gets a list of users that follow the specified broadcaster. You can also use this endpoint to see whether a specific user follows the broadcaster. This uses the token of the broadcaster by default. If you want to execute this in the context of another user (who has to be moderator of the channel) you can do so using user context overrides. ### Method GET ### Endpoint /channels/followers ### Parameters #### Query Parameters - **broadcaster** (UserIdResolvable) - Required - The broadcaster you want to get a list of followers for. - **user** (UserIdResolvable) - Optional - An optional user to determine if this user follows the broadcaster. If specified, the response contains this user if they follow the broadcaster. If not specified, the response contains all users that follow the broadcaster. - **pagination** (HelixForwardPagination) - Optional - Used for pagination. - **after** (string) - Optional - A cursor to get the following page of. - **limit** (number) - Optional - The number of results per page. ### Response #### Success Response (200) - **data** (HelixChannelFollower[]) - List of followers or a specific follow status. - **pagination** (HelixForwardPagination) - Pagination information. - **total** (number) - Total number of followers. ``` -------------------------------- ### ChatClientOptions Interface Source: https://twurple.js.org/reference/chat/interfaces/ChatClientOptions.html Configuration options for initializing a ChatClient instance. ```APIDOC ## Interface: ChatClientOptions ### Description Options used to configure the behavior and connection settings of a ChatClient. ### Properties - **authIntents** (string[]) - Optional - The intents to use to query the auth provider. - **authProvider** (AuthProvider) - Optional - The authentication provider to use for getting the chat credentials. - **botLevel** (TwitchBotLevel) - Optional - Your bot level ('none' | 'known' | 'verified'). Defaults to 'none'. - **channels** (ResolvableValue) - Optional - Channels to join after connecting. - **connectionOptions** (WebSocketConnectionOptions) - Optional - Connection options for a WebSocket connection. - **hostName** (string) - Optional - Custom hostname for connecting to chat. - **isAlwaysMod** (boolean) - Optional - Whether you're guaranteed to be a mod in all joined channels. - **legacyScopes** (boolean) - Optional - Whether to request a token with the old chat permission scope. - **logger** (Partial) - Optional - Options to pass to the logger. - **readOnly** (boolean) - Optional - Whether to request a token with only read permission. - **rejoinChannelsOnReconnect** (boolean) - Optional - Whether to rejoin the channels the client had joined when a reconnect occurs. - **requestMembershipEvents** (boolean) - Optional - Whether to receive JOIN and PART messages from Twitch chat. - **ssl** (boolean) - Optional - Whether to connect securely using SSL. - **webSocket** (boolean) - Optional - Whether to use a WebSocket to connect to chat. ``` -------------------------------- ### GET /channels/followed Source: https://twurple.js.org/reference/api/classes/HelixChannelApi.html Gets a list of broadcasters that the specified user follows. This can also be used to check whether the user follows a specific broadcaster. ```APIDOC ## GET /channels/followed ### Description Gets a list of broadcasters that the specified user follows. You can also use this endpoint to see whether the user follows a specific broadcaster. ### Method GET ### Endpoint /channels/followed ### Parameters #### Query Parameters - **user** (UserIdResolvable) - Required - The user that's getting a list of followed channels. This ID must match the user ID in the access token. - **broadcaster** (UserIdResolvable) - Optional - An optional broadcaster to determine if the user follows this broadcaster. If specified, the response contains this broadcaster if the user follows them. If not specified, the response contains all broadcasters that the user follows. - **pagination** (HelixForwardPagination) - Optional - Used for pagination. ### Response #### Success Response (200) - **data** (HelixFollowedChannel[]) - List of followed channels or a specific follow status. - **pagination** (HelixForwardPagination) - Pagination information. - **total** (number) - Total number of followed channels. ``` -------------------------------- ### DirectConnectionAdapter Constructor Source: https://twurple.js.org/reference/eventsub-http/classes/DirectConnectionAdapter.html Initializes a new DirectConnectionAdapter for direct WebHook communication. ```APIDOC ## Constructor: new DirectConnectionAdapter(options) ### Description Creates a new simple WebHook adapter that requires the server to be directly available to the internet. ### Parameters #### Request Body - **options** (DirectConnectionAdapterConfig) - Required - Configuration object - **options.hostName** (string) - Required - The host name the server is available under. - **options.sslCert** (EventSubHttpListenerCertificateConfig) - Required - The SSL keychain for secure connections. - **options.sslCert.cert** (string) - Required - Full SSL certificate chain. - **options.sslCert.key** (string) - Required - Private key of the SSL certificate. ``` -------------------------------- ### getIntentsForUser Source: https://twurple.js.org/reference/auth/classes/RefreshingAuthProvider.html Gets all intents assigned to the given user. ```APIDOC ## getIntentsForUser(user) ### Description Gets all intents assigned to the given user. ### Parameters #### Path Parameters - **user** (UserIdResolvable) - Required - The user to get intents of. ### Response - **Return Type** (string[]) - List of intents. ``` -------------------------------- ### GET /helix/schedule Source: https://twurple.js.org/reference/api/classes/HelixScheduleApi.html Retrieves the schedule for a specific broadcaster. ```APIDOC ## GET getSchedule ### Description Retrieves the schedule for a specific broadcaster. ### Method GET ### Endpoint client.schedule.getSchedule(broadcasterId) ### Parameters #### Path Parameters - **broadcasterId** (string) - Required - The ID of the broadcaster whose schedule is being retrieved. ### Request Example const { data: schedule } = await api.helix.schedule.getSchedule('61369223'); ### Response #### Success Response (200) - **data** (HelixSchedule) - The schedule object for the broadcaster. ``` -------------------------------- ### GET /getPredictionsByIds Source: https://twurple.js.org/reference/api/classes/HelixPredictionApi.html Retrieves multiple predictions by their IDs. ```APIDOC ## GET /getPredictionsByIds ### Description Gets predictions by IDs. ### Parameters #### Path Parameters - **broadcaster** (UserIdResolvable) - Required - The broadcaster to get the predictions for. - **ids** (string[]) - Required - The IDs of the predictions. ### Response - **Return type** (HelixPrediction[]) ``` -------------------------------- ### GET /getPredictionById Source: https://twurple.js.org/reference/api/classes/HelixPredictionApi.html Retrieves a specific prediction by its ID. ```APIDOC ## GET /getPredictionById ### Description Gets a prediction by ID. ### Parameters #### Path Parameters - **broadcaster** (UserIdResolvable) - Required - The broadcaster to get the prediction for. - **id** (string) - Required - The ID of the prediction. ### Response - **Return type** (HelixPrediction | null) ``` -------------------------------- ### Start a Raid using HelixRaidApi Source: https://twurple.js.org/reference/api/classes/HelixRaidApi.html Initiates a raid from one broadcaster to another. Requires the user IDs of both the raiding and the target broadcaster. Ensure you have the necessary permissions and that the target channel is live. ```javascript const api = new ApiClient({ authProvider }); const raid = await api.raids.startRaid('125328655', '61369223'); ``` -------------------------------- ### GET /getClipById Source: https://twurple.js.org/reference/api/classes/HelixClipApi.html Retrieves a specific clip by its ID. ```APIDOC ## GET /getClipById ### Description Gets the clip identified by the given ID. ### Method GET ### Endpoint /getClipById ### Parameters #### Query Parameters - **id** (string) - Required - Description: The clip ID. ### Response #### Success Response (200) - **HelixClip** (object | null) - Description: The clip object or null if not found. ### Response Example ```json { "id": "SomeClipId", "url": "https://clips.twitch.tv/SomeClipId", "broadcasterId": "12345", "broadcasterName": "SomeBroadcaster", "creatorId": "67890", "creatorName": "SomeCreator", "videoId": "11111", "gameId": "22222", "language": "en", "title": "My Awesome Clip", "viewCount": 100, "createdAt": "2023-01-01T12:00:00Z", "thumbnailUrl": "https://clips-media-assets.twitch.tv/SomeClipId/thumbnail-large.jpg" } ``` ``` -------------------------------- ### Constructor: new AppTokenAuthProvider Source: https://twurple.js.org/reference/auth/classes/AppTokenAuthProvider.html Initializes a new instance of the AppTokenAuthProvider to receive an application token using client credentials. ```APIDOC ## Constructor: new AppTokenAuthProvider(clientId, clientSecret, impliedScopes) ### Description Creates a new auth provider to receive an application token using the client ID and secret. ### Parameters #### Path Parameters - **clientId** (string) - Required - The client ID of your application. - **clientSecret** (string) - Required - The client secret of your application. - **impliedScopes** (string[]) - Optional - The scopes that are implied for your application. ``` -------------------------------- ### DirectConnectionAdapterConfig Source: https://twurple.js.org/reference/eventsub-http/interfaces/DirectConnectionAdapterConfig.html Configuration for the simple connection adapter. ```APIDOC ## DirectConnectionAdapterConfig ### Description The configuration of the simple connection adapter. ### Properties #### hostName - **hostName** (string) - The host name the server is available under. #### sslCert - **sslCert** (EventSubHttpListenerCertificateConfig) - The SSL keychain that should be used to make the server available using a secure connection. ``` -------------------------------- ### GET /broadcaster Source: https://twurple.js.org/reference/api/classes/HelixSchedule.html Retrieves detailed information about the broadcaster. ```APIDOC ## getBroadcaster() ### Description Gets more information about the broadcaster. ### Method async ### Response - **HelixUser** - The broadcaster information object. ``` -------------------------------- ### GET /helix/chat/settings Source: https://twurple.js.org/reference/api/interfaces/HelixBanFilter.html Retrieves the chat settings for a specified channel. ```APIDOC ## GET /helix/chat/settings ### Description Retrieves the chat settings for a specified channel. ### Method GET ### Endpoint /helix/chat/settings ### Parameters #### Query Parameters - **broadcasterId** (string) - Required - The ID of the broadcaster whose chat settings you want to retrieve. ### Response #### Success Response (200) - **data** (array) - An array containing a single object with the chat settings. - **broadcasterId** (string) - The ID of the broadcaster. - **broadcasterName** (string) - The login name of the broadcaster. - **moderatorId** (string) - The ID of the moderator making the request. - **moderatorName** (string) - The login name of the moderator. - **slowModeDuration** (number | null) - The duration of slow mode in seconds. Null if slow mode is not enabled. - **slowModeActive** (boolean) - Whether slow mode is currently active. - **followerModeActive** (boolean) - Whether follower-only mode is currently active. - **followerModeDuration** (number | null) - The duration in minutes for follower-only mode. Null if follower-only mode is not enabled. - **subscriberModeActive** (boolean) - Whether subscriber-only mode is currently active. - **uniqueChatModeActive** (boolean) - Whether unique chat mode is currently active. ### Response Example ```json { "data": [ { "broadcasterId": "12345", "broadcasterName": "somechannel", "moderatorId": "67890", "moderatorName": "moduser", "slowModeDuration": 30, "slowModeActive": true, "followerModeActive": false, "followerModeDuration": null, "subscriberModeActive": true, "uniqueChatModeActive": false } ] } ``` ``` -------------------------------- ### BotCommand Class Source: https://twurple.js.org/reference/easy-bot/classes/BotCommand.html Documentation for the BotCommand class, its properties, and methods. ```APIDOC ## BotCommand A base class to implement bot commands with advanced command matching. ### Overview #### Properties * aliases * name #### Methods * canExecute * execute * match For basic commands, it is recommended to use the createBotCommand helper instead. ## Properties ### aliases #### Type: string[] Additional names for the command. ### name #### Type: string The main name of the command. ## Methods ### canExecute(channelId, userId) Parameter| Type| Required| Default| Description ---|---|---|---|--- channelId| string| | _none_| _none_ userId| string| | _none_| _none_ Return type: boolean ### execute(params, context) Handles the command execution. Parameter| Type| Required| Default| Description ---|---|---|---|--- params| string[]| | _none_| The parameters returned by the matcher. context| BotCommandContext| | _none_| The command context. Return type: void | Promise ### match(line, prefix) Checks whether a message matches this command, and if it does, returns the parameters to pass to the execution handler. Parameter| Type| Required| Default| Description ---|---|---|---|--- line| string| | _none_| The text of the message. prefix| string| | _none_| The command prefix set in the bot configuration. Return type: string[] | null ``` -------------------------------- ### GET /helix/chat/badges/global Source: https://twurple.js.org/reference/api/interfaces/HelixBanFilter.html Retrieves the available global chat badges. ```APIDOC ## GET /helix/chat/badges/global ### Description Retrieves the available global chat badges. ### Method GET ### Endpoint /helix/chat/badges/global ### Response #### Success Response (200) - **data** (array) - An array of global badge objects. - **set_id** (string) - The ID of the badge set. - **versions** (array) - An array of badge versions. - **id** (string) - The ID of the badge version. - **image_url_1x** (string) - The URL for the 1x size badge image. - **image_url_2x** (string) - The URL for the 2x size badge image. - **image_url_4x** (string) - The URL for the 4x size badge image. - **title** (string) - The title of the badge. - **description** (string) - The description of the badge. - **click_action** (string) - The action to perform when the badge is clicked. - **click_url** (string) - The URL to navigate to when the badge is clicked. - **background_color** (string) - The background color of the badge. - **is_animated** (boolean) - Whether the badge is animated. ### Response Example ```json { "data": [ { "set_id": "subscriber", "versions": [ { "id": "0", "image_url_1x": "https://static-cdn.jtvnw.net/chat/badges/subscriber_0_1x.png", "image_url_2x": "https://static-cdn.jtvnw.net/chat/badges/subscriber_0_2x.png", "image_url_4x": "https://static-cdn.jtvnw.net/chat/badges/subscriber_0_4x.png", "title": "Subscriber", "description": "This user is a subscriber.", "click_action": "", "click_url": "", "background_color": "", "is_animated": false } ] } ] } ``` ``` -------------------------------- ### asIntent - Create API client for a specific intent Source: https://twurple.js.org/reference/api/classes/ApiClient.html Creates a contextualized ApiClient that can be used to call the API in the context of a given intent. The first matching intent from the provided list will be used. ```APIDOC ## asIntent(intents, runner) ### Description Creates a contextualized ApiClient that can be used to call the API in the context of a given intent. ### Method async ### Parameters #### Path Parameters - **intents** (string[]) - Required - A list of intents. The first one that is found in your auth provider will be used. - **runner** ((ctx: BaseApiClient) => Promise) - Required - The callback to execute. A parameter is passed that should be used in place of the normal `ApiClient` to ensure that all requests are executed in the given user's context. Please note that requests which require scope authorization ignore this context. The return value of your callback will be propagated to the return value of this method. ### Return type T ``` -------------------------------- ### GET /videos/user Source: https://twurple.js.org/reference/api/classes/HelixVideoApi.html Retrieves videos associated with a specific user. ```APIDOC ## GET /videos/user ### Description Gets the videos of the given user. ### Parameters #### Query Parameters - **user** (UserIdResolvable) - Required - The user you want to get videos from. - **filter** (HelixPaginatedVideoFilter) - Optional - Filtering options including after, before, language, limit, orderBy, period, and type. ### Response #### Success Response (200) - **HelixPaginatedResult** - A paginated result containing video data. ``` -------------------------------- ### Method: join Source: https://twurple.js.org/reference/chat/classes/ChatClient.html Joins a specified channel. ```APIDOC ## Method: join ### Description Joins a channel. ### Parameters - **channel** (string) - The channel to join. ``` -------------------------------- ### GET /getPredictionsPaginated Source: https://twurple.js.org/reference/api/classes/HelixPredictionApi.html Creates a paginator for predictions for the given broadcaster. ```APIDOC ## GET /getPredictionsPaginated ### Description Creates a paginator for predictions for the given broadcaster. ### Parameters #### Path Parameters - **broadcaster** (UserIdResolvable) - Required - The broadcaster to get predictions for. ### Response - **Return type** (HelixPaginatedRequest) ``` -------------------------------- ### getExtensionDeveloperConfiguration Source: https://twurple.js.org/reference/ebs-helper/functions/getExtensionDeveloperConfiguration.html Fetches the developer configuration of an extension for a broadcaster. ```APIDOC ## GET /extensions/developer_configuration ### Description Fetches the developer configuration of an extension for a broadcaster. ### Method GET ### Endpoint `/extensions/developer_configuration` ### Parameters #### Query Parameters - **clientId** (string) - Required - The client ID of the extension. - **ownerId** (string) - Required - The user ID of the extension's owner. - **broadcasterId** (string) - Required - The broadcaster to fetch the configuration for. ### Request Example ```json { "clientId": "your_client_id", "ownerId": "your_owner_id", "broadcasterId": "broadcaster_user_id" } ``` ### Response #### Success Response (200) - **configurationSegment** (string) - The developer configuration segment for the extension. - **content** (string) - The content of the configuration. #### Response Example ```json { "configurationSegment": "developer.important.settings", "content": "{\"theme\": \"dark\", \"fontSize\": 14}" } ``` ``` -------------------------------- ### Constructor: new HellFreezesOverError(message) Source: https://twurple.js.org/reference/common/classes/HellFreezesOverError.html Initializes a new instance of the HellFreezesOverError class. ```APIDOC ## Constructor: new HellFreezesOverError(message) ### Description Represents an error that should never occur. If encountered, please report it to the GitHub issue tracker. ### Parameters #### Path Parameters - **message** (string) - Required - The error message describing the unexpected state. ``` -------------------------------- ### GET /getPredictions Source: https://twurple.js.org/reference/api/classes/HelixPredictionApi.html Retrieves a paginated list of predictions for a broadcaster. ```APIDOC ## GET /getPredictions ### Description Gets a list of predictions for the given broadcaster. ### Parameters #### Path Parameters - **broadcaster** (UserIdResolvable) - Required - The broadcaster to get predictions for. #### Query Parameters - **pagination.after** (string) - Optional - A cursor to get the following page of. - **pagination.limit** (number) - Optional - The number of results per page. ### Response - **Return type** (HelixPaginatedResult) ``` -------------------------------- ### GET /helix/predictions Source: https://twurple.js.org/reference/api/classes/HelixPredictionApi.html Retrieves a list of predictions for a specific broadcaster. ```APIDOC ## GET /helix/predictions ### Description Retrieves a list of predictions for a specific broadcaster. ### Method GET ### Endpoint /helix/predictions ### Parameters #### Query Parameters - **broadcasterId** (string) - Required - The ID of the broadcaster to retrieve predictions for. ### Request Example ```javascript const api = new ApiClient({ authProvider }); const { data: predictions } = await api.helix.predictions.getPredictions('61369223'); ``` ### Response #### Success Response (200) - **data** (Array) - A list of prediction objects. ``` -------------------------------- ### StaticAuthProvider Constructor Source: https://twurple.js.org/reference/auth/classes/StaticAuthProvider.html Initializes a new StaticAuthProvider with static credentials. You can provide an access token and its associated scopes, or let the provider fetch the correct scopes if not provided. ```APIDOC ## new StaticAuthProvider(clientId, accessToken, scopes) ### Description Creates a new auth provider with static credentials. ### Parameters #### Path Parameters - **clientId** (string) - Required - The client ID of your application. - **accessToken** (AccessToken) - Required - The access token to provide. You need to obtain one using one of the Twitch OAuth flows. - **scopes** (string[]) - Optional - The scopes the supplied token has. If this argument is given, the scopes need to be correct, or weird things might happen. If it's not (i.e. it's `undefined`), we fetch the correct scopes for you. If you can't exactly say which scopes your token has, don't use this parameter/set it to `undefined`. ```