Skip to main content

Overview

The Akapulu React SDK exposes a normalized conversation event stream through useAkapuluEvents(...). This hook lets you react to conversation lifecycle changes, transcript updates, tool events, node changes, bot speaking state, and timeout events.

Event handling

Use useAkapuluEvents(listener) anywhere under AkapuluProvider.

Hook signature

(event: AkapuluEvent) => void
required
Listener invoked whenever the Akapulu session store emits a normalized event.

Main unions

SessionStatus

BotSpeakingState

ToolMessageType

TimeoutReason

Event types

status_changed

"status_changed"
Event discriminator.
"idle" | "connecting" | "connected" | "disconnecting" | "ended" | "error"
Current high-level session lifecycle state.

bot_speaking_state_changed

"bot_speaking_state_changed"
Event discriminator.
"idle" | "speaking" | "listening"
Current speaking or listening state for the bot participant.

node_changed

"node_changed"
Event discriminator.
{ key: string; label: string } | null
Current scenario node, or null if no node is active.

tool_event

"tool_event"
Event discriminator.
NormalizedToolEvent
Normalized tool event payload.

transcript_updated

"transcript_updated"
Event discriminator.
TranscriptEntry
Transcript row payload.

call_ready

"call_ready"
Event discriminator indicating the call reached ready state.

timeout

"timeout"
Event discriminator.
"duration_limit_reached" | "participant_join_timeout"
Timeout reason reported by the backend.