TwurpleAuthenticationGetting dataExamplesFAQMigration

Main classes

HelixEntitlementApi

The Helix API methods that deal with entitlements (drops).

Overview

Can be accessed using client.entitlements on an ApiClient instance.

Example

const api = new ApiClient({ authProvider });
const clipId = await api.entitlements.getDropsEntitlements();

Methods

getDropsEntitlementById(id)

async

Gets the drops entitlement for the given ID.

ParameterTypeRequiredDefaultDescription
idstringnone

The ID to fetch.

Return type: HelixDropsEntitlement | null

getDropsEntitlementByIdBatched(id)

async

Gets the drops entitlement for the given ID, batching multiple calls into fewer requests as the API allows.

ParameterTypeRequiredDefaultDescription
idstringnone

The ID to fetch.

Return type: HelixDropsEntitlement | null

getDropsEntitlements(filter, alwaysApp)

async

Gets the drops entitlements for the given filter.

ParameterTypeRequiredDefaultDescription
filterHelixDropsEntitlementPaginatedFilternonesee below
filter.afterstringnone

A cursor to get the following page of.

filter.beforestringnone

A cursor to get the previous page of.

filter.fulfillmentStatus
HelixDropsEntitlementFulfillmentStatus

The fulfillment status of a drop entitlement.

Aliased type: "CLAIMED" | "FULFILLED"

none

The fulfillment status to find entitlements for.

filter.gameIdstringnone

The ID of the game to find entitlements for.

filter.limitnumbernone

The number of results per page.

filter.user
UserIdResolvable

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.

Aliased type: string | number | UserIdResolvableType

none

The user to find entitlements for.

alwaysAppbooleanfalse

Whether an app token should always be used, even if a user filter is given.

getDropsEntitlementsByIds(ids)

async

Gets the drops entitlements for the given IDs.

ParameterTypeRequiredDefaultDescription
idsstring[]none

The IDs to fetch.

Return type: HelixDropsEntitlement[]

getDropsEntitlementsPaginated(filter, alwaysApp)

Creates a paginator for drops entitlements for the given filter.

ParameterTypeRequiredDefaultDescription
filterHelixDropsEntitlementFilternonesee below
filter.fulfillmentStatus
HelixDropsEntitlementFulfillmentStatus

The fulfillment status of a drop entitlement.

Aliased type: "CLAIMED" | "FULFILLED"

none

The fulfillment status to find entitlements for.

filter.gameIdstringnone

The ID of the game to find entitlements for.

filter.user
UserIdResolvable

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.

Aliased type: string | number | UserIdResolvableType

none

The user to find entitlements for.

alwaysAppbooleanfalse

Whether an app token should always be used, even if a user filter is given.

Return type: HelixPaginatedRequest<HelixDropsEntitlementData, HelixDropsEntitlement>

updateDropsEntitlements(ids, fulfillmentStatus)

async

Updates the status of a list of drops entitlements.

Returns a map that associates each given ID with its update status.

ParameterTypeRequiredDefaultDescription
idsstring[]none

The IDs of the entitlements.

fulfillmentStatus
HelixDropsEntitlementFulfillmentStatus

The fulfillment status of a drop entitlement.

Aliased type: "CLAIMED" | "FULFILLED"

none

The fulfillment status to set the entitlements to.

Return type: Map<string, HelixDropsEntitlementUpdateStatus>