Sends a custom alert to the authorized streamer.
This method sends a custom-designed alert to the specified user (streamer). The customizable fields include the header, message, image, and sound. To display in the streamer's widget, the alert type must be configured as "Custom alerts" in their settings.
The ID of the user to send the custom alert to.
The data object containing properties for the custom alert, such as header, message, or sound URL.
Optional
rateLimiterOptions: RateLimiterRequestOptionsOptional rate limiting configuration.
An instance of the newly created DonationAlertsCustomAlert.
HttpError if the HTTP status code is outside the range of 200–299.
UnregisteredUserError if the specified user is not registered in the authentication provider.
MissingScopeError if the access token lacks the necessary oauth-custom_alert-store
scope.
const customAlert = await customAlertsApi.sendCustomAlert(userId, {
externalId: 'unique-alert-id',
header: 'Custom Title!',
message: 'Custom message.',
shouldShow: true, // Will be displayed
imageUrl: 'https://example.com/image.jpg',
soundUrl: 'https://example.com/sound.mp3'
});
console.log(`Custom alert sent! Header: ${customAlert.header}; Message: ${customAlert.message}`);
API for managing Donation Alerts custom alerts.
Custom alerts allow developers to create fully customizable notifications that broadcast to a streamer's audience. These alerts can include custom headers, messages, images, and sounds for a tailored viewer experience.
Remarks
Important: For the custom alert to display, the streamer must configure a variation in the Alerts widget with the "Custom alerts" type.