Interaction Events
Events fired during user interactions.
ButtonClickEvent
Fired when a button is clicked.
interface ButtonClickEvent extends BaseSDKEvent {
type: 'button_click';
button_id: string;
button_text: string;
screen_id: string;
action: 'navigate' | 'none';
target_screen_id?: string;
}| Field | Type | Description |
|---|---|---|
button_id | string | Unique button identifier |
button_text | string | Button label text |
screen_id | string | Current screen ID |
action | 'navigate' | 'none' | Button action type |
target_screen_id | string? | Target screen (if action is navigate) |
<BegynnOnboarding
placementId="your-placement-id"
onButtonClick={(event) => {
console.log("Button clicked:", event.button_text);
if (event.action === 'navigate') {
console.log("Navigating to:", event.target_screen_id);
}
}}
/>ChoiceSelectEvent
Fired when a choice is selected in a choicelist.
interface ChoiceSelectEvent extends BaseSDKEvent {
type: 'choice_select';
choicelist_id: string;
option_id: string;
option_title: string;
screen_id: string;
mode: 'single' | 'multiple';
all_selected: string[];
}| Field | Type | Description |
|---|---|---|
choicelist_id | string | Choicelist identifier |
option_id | string | Selected option ID |
option_title | string | Selected option text |
screen_id | string | Current screen ID |
mode | 'single' | 'multiple' | Selection mode |
all_selected | string[] | All currently selected option IDs |
<BegynnOnboarding
placementId="your-placement-id"
onChoiceSelect={(event) => {
console.log("Selected:", event.option_title);
console.log("All selections:", event.all_selected);
if (event.mode === 'multiple') {
console.log("User can select more options");
}
}}
/>ChoiceDeselectEvent
Fired when a choice is deselected (in multiple selection mode).
interface ChoiceDeselectEvent extends BaseSDKEvent {
type: 'choice_deselect';
choicelist_id: string;
option_id: string;
option_title: string;
screen_id: string;
all_selected: string[];
}| Field | Type | Description |
|---|---|---|
choicelist_id | string | Choicelist identifier |
option_id | string | Deselected option ID |
option_title | string | Deselected option text |
screen_id | string | Current screen ID |
all_selected | string[] | Remaining selected option IDs |
<BegynnOnboarding
placementId="your-placement-id"
onChoiceDeselect={(event) => {
console.log("Deselected:", event.option_title);
console.log("Remaining selections:", event.all_selected);
}}
/>Last updated on