Overview
@akapulu/react is the lower-level React package in the Akapulu Web SDK.
It gives you the provider, hooks, and media helpers you need to build your own React conversation UI.
Installation
Quickstart
AkapuluProvider takes paths to your local API routes:
connectPathupdatesPath
@akapulu/server.
Main exports
The public exports currently include:AkapuluProvideruseAkapuluSessionuseAkapuluEventsuseAkapuluDailyCalluseAkapuluMediaControlsAkapuluBotAudioAkapuluConfigAkapuluEvent
Provider
AkapuluProvider wraps your app and creates the conversation session store.
AkapuluConfig includes:
Local connect endpoint called by the browser.
Local updates endpoint called by the browser.
Optional JSON payload forwarded to your local connect route.
Optional polling interval override for the local updates route.
status === "connecting", the React SDK waits up to 100 seconds for the backend to report that the call is ready.
If the updates route never reports call_is_ready: true within that window, the session transitions to:
status: "error"error.code: "UPDATES_TIMEOUT"error.message: "Timed out waiting for assistant to become ready."
Optional custom transport implementation.
end() from useAkapuluSession(). That leaves the Daily room from the browser and runs the SDK teardown so the session is no longer live. If the assistant disconnects from Daily first, AkapuluProvider calls end() for you so status does not stay connected with no assistant in the room.
Hooks
useAkapuluSession()
Call useAkapuluSession() anywhere under AkapuluProvider. It exposes everything in the session store plus start / end:
status— where the client is in the join/leave flow:"idle"→"connecting"→"connected"→"disconnecting"/"ended", or"error"if something failed.start/end— async actions that begin the conversation (connect + Daily join) or hang up and reset session state.error— whenstatusis"error", structured details (codeoptional,messagerequired) for your error UI or logging.
callIsReady— whether the backend considers the call ready (often used whilestatus === "connecting"so you are not stuck on a spinner forever).completionPercent— numeric progress through the scenario (0–100).latestUpdateText— short human-readable status line for loading/progress copy.
currentNode— the active scenario node ({ key, label }) ornullif none.
transcripts— ordered list of rows (id,text,speaker,timestamp,isFinal) for your own transcript UI.botSpeakingState—"idle","speaking", or"listening"for indicators or turn-taking UI.
conversationSessionId— Akapulu conversation session id from connect (used when polling updates; also useful if your app logs or links out to dashboard/API records).
useAkapuluEvents(listener)
Subscribes to the normalized AkapuluEvent stream.
See Callbacks and events.
useAkapuluMediaControls()
Returns media control helpers for the underlying Daily call.
useAkapuluDailyCall()
Returns the active Daily call object for the current session—the same DailyCall instance AkapuluProvider wires into Daily’s DailyProvider. Before the client exists, this hook returns null.
For most React UI you should use @daily-co/daily-react under AkapuluProvider; useDaily() reads that call object from context and is the usual way to drive video tiles, participants, and tracks. Use useAkapuluDailyCall() when you want the call object reference directly (for example code aligned with Daily call-object methods without importing useDaily).
Main unions and types
SessionStatus
status: "error", the SDK disconnects from the active Daily call and clears the active session state before surfacing the error to your UI.
BotSpeakingState
AkapuluEvent
The main event union includes:
status_changedbot_speaking_state_changednode_changedtool_eventtranscript_updatedcall_readytimeout
When to use this package
Use@akapulu/react when you want to:
- build your own layout
- render your own transcript UI
- control how tool events appear
- own your call controls and post-call flow

