embed.on(EmbedEvent.CustomAction, (payload: CustomActionEventPayload) => {
if (payload.data.id === 'my-action') {
payload.answerService?.getUnderlyingDataForPoint([]);
}
});
CustomActionEventPayload
`CustomActionEventPayload : `
Payload delivered to on(EmbedEvent.CustomAction). Beyond the wire fields,
the SDK attaches an AnswerService built from the event’s session and
answer data (see utils/processData.ts processCustomAction) — annotate your
callback with this type to access it:
It is a dedicated type rather than folded into `on()’s generic callback because the SDK’s event registry types callbacks as the plain MessagePayload, which the enrichment cannot be intersected into without restructuring that registry.
Defined in : contracts/embed-event-payloads.ts