From Bright Pattern Documentation
Jump to: navigation, search
• 5.19


This handler is invoked when the active interaction in the Agent Desktop application switches from one active interaction to another active interaction.



on('ON_ACTIVE_INTERACTION_SWITCHED', handler: OnActiveInteractionSwitchHandler): void

type OnActiveInteractionSwitchHandler = (activatedInteractionId: string | null) => void


Parameter Parameter Values Data Type Optional/Required Description
activatedInteractionId String


Required The ID of the currently activated interaction.

Note that the type can be null if there is a completed interaction, and the system recognizes there is no longer an active interaction.

Example Request

const activeInteractionId: string | null = null;

function interactionSwitchedCallback(newId: string | null) {

activeInteractionId = newId;


adApi.on("ON_ACTIVE_INTERACTION_SWITCHED", interactionSwitchedCallback);

Return Value

< Previous | Next >