Action handlers
ActionHandler
An array of actions, where each action includes:
- actionId: The type of action, as an
ActionHandlerIdvalue ('addCustomActionButton'or'addFollowButton'). - options: Defines properties based on the type of action handler.
export type ActionHandler = {
actionId: `${ActionHandlerId}`;
options: CustomActionButtonOptions | FollowButtonOptions;
};
export type CustomActionButtonOptions = {
id: string;
buttonName: string;
onClick: (e: MouseEvent | Event, data: ContentEntities | null) => void;
};
export type FollowButtonOptions = {
onClick: (e: MouseEvent | Event, data: FollowingSharedContext) => void;
};| Property | Type | Description |
|---|---|---|
ActionHandler | Object | Represents an action handler. |
actionId | ActionHandlerId | The type of action. One of the ActionHandlerId values. |
options | CustomActionButtonOptions | FollowButtonOptions | Defines action handler properties. |
| CustomActionButtonOptions | Object | Configuration for the action button. |
id | string | Required. Stable identifier for the button, used to group its analytics. |
buttonName | string | The label displayed on the button. |
onClick | (e: MouseEvent | Event, data: ContentEntities | null) => void | Callback function triggered when the button is clicked. |
| FollowButtonOptions | Object | Configuration for the follow button. |
onClick | (e: MouseEvent | Event, data: FollowingSharedContext) => void | Callback function triggered when the follow button is clicked. |
| ActionHandlerId | Enum | Predefined action identifiers. |
AddCustomActionButton | 'addCustomActionButton' | Represents an action to add a custom button. |
AddFollowButton | 'addFollowButton' | Represents an action to add a follow button. Currently supported only for moments. |
Pass actionHandlers as part of IWidgetViewOptions when you create a widget, or to playContent. See BlazeSDK class.
Updated 12 days ago
Did this page help you?
