@bodhi_lab/bodhi-web-sdk
v0.1.0
Published
Thin web helpers for calling hosted Bodhi embed APIs
Readme
@bodhi_lab/bodhi-web-sdk
Thin browser helpers for calling hosted Bodhi embed APIs.
Scope
This package does not include any agent runtime or backend logic.
It only helps your app:
- call
POST /api/embed/avatar-sessionsfor a savedua_*agent - call
POST /api/embed/widget-sessionsfor a publishedwg_*widget - build the hosted
/embed/avatariframe URL
Example
import {
buildEmbedAvatarPageUrl,
createAgentAvatarEmbedSession,
} from '@bodhi_lab/bodhi-web-sdk';
const session = await createAgentAvatarEmbedSession(
'https://YOUR_BODHI_API_ORIGIN',
'ua_0123456789abcdef',
{
headers: {
Authorization: 'Bearer YOUR_AUTH_TOKEN',
},
},
);
const iframeUrl = buildEmbedAvatarPageUrl(
'https://YOUR_BODHI_WEB_ORIGIN',
session,
).toString();