@bodhi_lab/bodhi-widget
v0.1.0
Published
React components for embedding hosted Bodhi agents and widgets
Downloads
62
Readme
@bodhi_lab/bodhi-widget
Small React components for embedding hosted Bodhi agents and widgets.
Scope
This package does not ship agent runtime logic.
It only:
- calls your existing Bodhi API
- creates a short-lived embed session
- renders the hosted
/embed/avatariframe
Components
BodhiWidgetFramefor publishedwg_*widgetsBodhiAgentFramefor savedua_*agents
Example: published widget
import { BodhiWidgetFrame } from '@bodhi_lab/bodhi-widget';
export function Demo() {
return (
<BodhiWidgetFrame
apiBaseUrl="https://YOUR_BODHI_API_ORIGIN"
webBaseUrl="https://YOUR_BODHI_WEB_ORIGIN"
widgetId="wg_0123456789abcdef"
style={{ minHeight: 720 }}
/>
);
}Example: saved agent
import { BodhiAgentFrame } from '@bodhi_lab/bodhi-widget';
export function Demo() {
return (
<BodhiAgentFrame
apiBaseUrl="https://YOUR_BODHI_API_ORIGIN"
webBaseUrl="https://YOUR_BODHI_WEB_ORIGIN"
agentProfile="ua_0123456789abcdef"
authToken="YOUR_AUTH_TOKEN"
/>
);
}Zero-build script install
For plain script-tag installs, keep using the hosted bodhi-widget.js from your Bodhi web app.
