Class DonationAlertsDonationsApi

Donation Alerts Donations API.

This API provides functionality to fetch donations associated with a streamer’s account. It supports fetching donations page-by-page, retrieving all donations, and working with paginators for more flexible data handling.

The API methods require the oauth-donation-index scope to access the data.

Hierarchy

  • BaseApi
    • DonationAlertsDonationsApi

Methods

  • Creates a paginator for fetching donation data.

    The paginator provides flexibility by allowing you to fetch donation data page-by-page. This is especially useful for handling large datasets incrementally.

    Parameters

    • user: UserIdResolvable

      The ID of the user to fetch donations for.

    • OptionalrateLimiterOptions: RateLimiterRequestOptions

      Optional Rate Limiter configuration.

    Returns DonationAlertsApiPaginator<DonationAlertsDonationData, DonationAlertsDonation>

    A DonationAlertsApiPaginator instance for donations.

    Requires the oauth-donation-index scope.

    Fetch the next page

    const paginator = apiClient.donations.createDonationsPaginator(userId);
    const firstPage = await paginator.getNext();
    console.log(firstPage.data); // donations from the first page

    Iterate over paginator

    const paginator = apiClient.donations.createDonationsPaginator(userId);

    for await (const pageDonations of paginator) {
    console.log(pageDonations);
    }