GuidesAPI ReferenceRelease Notes
HomeLog InHome
Guides

Action handlers

ActionHandler

Array of actions, each action has id and options.

An array of actions, where each action includes:

  • id: A unique identifier for the action.
  • options: Defines properties based on type of action handler.
export type ActionHandler = {
  actionId: `${ActionHandlerId}`;
  options: CustomActionButtonOptions | FollowButtonOptions;
};

export type CustomActionButtonOptions = {
  buttonName: string;
  onClick: (e: MouseEvent | Event, data: ContentEntities | null) => void;
};

export type FollowButtonOptions = {
  onClick: (e: MouseEvent | Event, data: FollowingSharedContext) => void;
};
PropertyTypeDescription
ActionHandlerObjectRepresents an action handler.
actionIdActionHandlerIdA unique identifier for the action.
optionsCustomActionButtonOptions | FollowButtonOptionsDefines action handler properties.
CustomActionButtonOptionsObjectConfiguration for the action button.
buttonNamestringThe label displayed on the button.
onClick(e: MouseEvent | Event, data: ContentEntities | null) => voidCallback function triggered when the button is clicked.
FollowButtonOptionsObjectConfiguration for the follow button.
onClick(e: MouseEvent | Event, data: FollowingSharedContext) => voidCallback function triggered when the follow button is clicked.
ActionHandlerIdEnumPredefined 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.


Did this page help you?