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
checkUserSubscription(user, broadcaster)
asyncChecks if a given user is subscribed to a given broadcaster. Returns null if not subscribed.
This checks with the authorization of a user. If you only have the authorization of a broadcaster, check HelixSubscriptionApi#getSubscriptionForUser.
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
user | UserIdResolvable | none | The broadcaster to check the user's subscription for. | |
broadcaster | UserIdResolvable | none | The user to check. |
getSubscriptionEventById(id)
asyncRetrieves a single subscription event by ID.
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
id | string | none | The event ID. |
getSubscriptionEventsForBroadcaster(broadcaster)
asyncRetrieves 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. |
getSubscriptionForUser(broadcaster, user)
asyncRetrieves the subscription data for a given user to a given broadcaster.
This checks with the authorization of a broadcaster. If you only have the authorization of a user, check HelixSubscriptionApi#checkUserSubscription.
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
broadcaster | UserIdResolvable | none | The broadcaster to check. | |
user | UserIdResolvable | none | The user to check. |
getSubscriptions(broadcaster)
asyncRetrieves 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)
asyncRetrieves 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. |
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. |