@claudebernard/chatbot-cbia
v1.14.1
Published
Claude Bernard IA widget — embeddable medical assistant for healthcare software
Readme
@claudebernard/chatbot-cbia
Claude Bernard IA widget — an embeddable medical assistant for healthcare software.
The widget mounts inside an isolated <iframe> on top of the host application and calls the
Claude Bernard IA API directly from the practitioner's browser. React is embedded in the
package: no peer dependency to install, and no conflict with the host's own React version.
Installation
npm install @claudebernard/chatbot-cbiaNo stylesheet to import — the widget injects its own styles inside its iframe.
Usage
import { initClaudeBernardWidget } from '@claudebernard/chatbot-cbia';
const widget = initClaudeBernardWidget({
apiUrl: 'https://platform.claudebernard.fr/api/agent-server',
apiKey: '…',
assistantId: '…',
getPatientContext: () => hostApp.currentPatient?.fhirBundle,
});
// when the host screen unmounts
widget.destroy();apiUrl, apiKey and assistantId are provided by the Claude Bernard IA team during
onboarding. The API key is passed on the browser side: the integrator is responsible for how it
is stored, distributed and rotated.
initClaudeBernardWidget() must be called on the client side only, and only one widget instance
is supported per page. Call destroy() before mounting a new one.
Patient context
getPatientContext is read on every question asked, so switching patient in the host
software is picked up without reopening the widget. It must return the FHIR bundle of the patient
currently displayed, or undefined when no patient is loaded — the assistant then answers
without patient context.
The bundle is forwarded as is, and must follow the Agent Server contract: a container FHIR
Bundle whose entry holds a second bundle carrying the Patient resource.
Documentation
Full integration guide, appearance parameters and FHIR data model: https://platform.claudebernard.fr
