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

HelixSubscriptionApi

The Helix API methods that deal with subscriptions.

Overview

Can be accessed using client.helix.subscriptions on an ApiClient instance.

Example

const api = new ApiClient(new StaticAuthProvider(clientId, accessToken));
const subscription = await api.helix.subscriptions.getSubscriptionForUser('61369223', '125328655');

Methods

getSubscriptionEventById(id)

async

Retrieves a single subscription event by ID.

Parameter Type Required Default Description
id string none

The event ID.

Return type: HelixSubscriptionEvent | null

getSubscriptionEventsForBroadcaster(broadcaster)

async

Retrieves the most recent subscription events for a given broadcaster.

Parameter Type Required Default Description
broadcaster UserIdResolvable none

The broadcaster to retrieve subscription events for.

getSubscriptionEventsForBroadcasterPaginated(broadcaster)

Creates a paginator for the recent subscription events for a given broadcaster.

Parameter Type Required Default Description
broadcaster UserIdResolvable none

The broadcaster to retrieve subscription events for.

Return type: HelixPaginatedRequest<HelixSubscriptionEventData, HelixSubscriptionEvent>

getSubscriptionForUser(broadcaster, user)

async

Retrieves the subscription data for a given user to a given broadcaster.

Parameter Type Required Default Description
broadcaster UserIdResolvable none

The broadcaster to check.

user UserIdResolvable none

The user to check.

Return type: HelixSubscription | null

getSubscriptions(broadcaster)

async

Retrieves a list of all subscriptions to a given broadcaster.

Parameter Type Required Default Description
broadcaster UserIdResolvable none

The broadcaster to list subscriptions to.

getSubscriptionsForUsers(broadcaster, users)

async

Retrieves the subset of the given user list that is subscribed to the given broadcaster.

Parameter Type Required Default Description
broadcaster UserIdResolvable none

The broadcaster to find subscriptions to.

users Array<UserIdResolvable> none

The users that should be checked for subscriptions.

Return type: Array<HelixSubscription>

getSubscriptionsPaginated(broadcaster)

Creates a paginator for all subscriptions to a given broadcaster.

Parameter Type Required Default Description
broadcaster UserIdResolvable none

The broadcaster to list subscriptions to.

Return type: HelixPaginatedRequest<HelixSubscriptionData, HelixSubscription>