Overview
Can be accessed using client.channelPoints
on an ApiClient instance.
Example
const api = new ApiClient({ authProvider }); const rewards = await api.channelPoints.getCustomRewards('125328655');
Methods
createCustomReward(broadcaster, data)
asyncCreates a new custom reward.
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
broadcaster | 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 broadcaster to create the reward for. | |
data | HelixCreateCustomRewardData | none | The reward data. | |
data.autoFulfill | boolean | none | Whether the redemption should automatically set its status to fulfilled. | |
data.backgroundColor | string | none | The hex code of the background color of the reward. | |
data.cost | number | none | The channel points cost of the reward. | |
data.globalCooldown | number | null | none | The cooldown between two redemptions of the reward, in seconds. 0 or | |
data.isEnabled | boolean | none | Whether the reward is enabled (shown to users). | |
data.maxRedemptionsPerStream | number | null | none | The maximum number of redemptions of the reward per stream. 0 or | |
data.maxRedemptionsPerUserPerStream | number | null | none | The maximum number of redemptions of the reward per stream for each user. 0 or | |
data.prompt | string | none | The prompt shown to users when redeeming the reward. | |
data.title | string | none | The title of the reward. | |
data.userInputRequired | boolean | none | Whether the reward requires user input to be redeemed. |
deleteCustomReward(broadcaster, rewardId)
asyncDeletes a custom reward.
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
broadcaster | 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 broadcaster to delete the reward for. | |
rewardId | string | none | The ID of the reward. |
getCustomRewardById(broadcaster, rewardId)
asyncGets a custom reward by ID.
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
broadcaster | 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 broadcaster to get the reward for. | |
rewardId | string | none | The ID of the reward. |
getCustomRewards(broadcaster, onlyManageable)
asyncGets all custom rewards for the given broadcaster.
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
broadcaster | 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 broadcaster to get the rewards for. | |
onlyManageable | boolean | none | Whether to only get rewards that can be managed by the API. |
getCustomRewardsByIds(broadcaster, rewardIds)
asyncGets custom rewards by IDs.
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
broadcaster | 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 broadcaster to get the rewards for. | |
rewardIds | string[] | none | The IDs of the rewards. |
getRedemptionById(broadcaster, rewardId, redemptionId)
asyncGets a custom reward redemption by ID.
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
broadcaster | 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 broadcaster to get the redemption for. | |
rewardId | string | none | The ID of the reward. | |
redemptionId | string | none | The ID of the redemption. |
getRedemptionsByIds(broadcaster, rewardId, redemptionIds)
asyncGets custom reward redemptions by IDs.
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
broadcaster | 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 broadcaster to get the redemptions for. | |
rewardId | string | none | The ID of the reward. | |
redemptionIds | string[] | none | The IDs of the redemptions. |
getRedemptionsForBroadcaster(broadcaster, rewardId, status, filter)
asyncGets custom reward redemptions for the given broadcaster.
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
broadcaster | 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 broadcaster to get the redemptions for. | |
rewardId | string | none | The ID of the reward. | |
status | HelixCustomRewardRedemptionStatus The possible statuses of a custom Channel Points reward redemption. Aliased type: "UNFULFILLED" | The possible statuses of a custom Channel Points reward redemption you can set. Aliased type: "FULFILLED" | "CANCELED" | none | The status of the redemptions to get. | |
filter | HelixPaginatedCustomRewardRedemptionFilter | none | see below | |
filter.after | string | none | A cursor to get the following page of. | |
filter.limit | number | none | The number of results per page. | |
filter.newestFirst | boolean | none | Whether to put the newest redemptions first. Oldest redemptions are shown first by default. |
getRedemptionsForBroadcasterPaginated(broadcaster, rewardId, status, filter)
Creates a paginator for custom reward redemptions for the given broadcaster.
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
broadcaster | 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 broadcaster to get the redemptions for. | |
rewardId | string | none | The ID of the reward. | |
status | HelixCustomRewardRedemptionStatus The possible statuses of a custom Channel Points reward redemption. Aliased type: "UNFULFILLED" | The possible statuses of a custom Channel Points reward redemption you can set. Aliased type: "FULFILLED" | "CANCELED" | none | The status of the redemptions to get. | |
filter | HelixCustomRewardRedemptionFilter | none | see below | |
filter.newestFirst | boolean | none | Whether to put the newest redemptions first. Oldest redemptions are shown first by default. |
updateCustomReward(broadcaster, rewardId, data)
asyncUpdates a custom reward.
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
broadcaster | 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 broadcaster to update the reward for. | |
rewardId | string | none | The ID of the reward. | |
data | HelixUpdateCustomRewardData | none | The reward data. |
updateRedemptionStatusByIds(broadcaster, rewardId, redemptionIds, status)
asyncUpdates the status of the given redemptions by IDs.
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
broadcaster | 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 broadcaster to update the redemptions for. | |
rewardId | string | none | The ID of the reward. | |
redemptionIds | string[] | none | The IDs of the redemptions to update. | |
status | HelixCustomRewardRedemptionTargetStatus The possible statuses of a custom Channel Points reward redemption you can set. Aliased type: "FULFILLED" | "CANCELED" | none | The status to set for the redemptions. |