Integrating via NPM
Use the Sentifyd npm packages to integrate an avatar into React, Vue, Next.js, or any modern JavaScript application, with full bundler integration and TypeScript support.
Two packages are available. Install the one that matches your avatar's voice mode (selected when the avatar was created):
The examples below use sentifyd-bot; substitute sentifyd-realtime (and the matching import names) for real-time avatars.
Installation
npm install sentifyd-bot
# or
yarn add sentifyd-botVite Configuration (Required)
The package requires a Vite plugin to correctly serve the 3D avatar's assets and the audio worklets used for lip-sync. Add it to your vite.config.js:
import { defineConfig } from 'vite';
import { sentifydBotPlugin } from 'sentifyd-bot/vite-plugin';
export default defineConfig({
plugins: [
sentifydBotPlugin()
]
});For sentifyd-realtime, import sentifydRealtimePlugin from sentifyd-realtime/vite-plugin instead.
Framework Examples
React
The React wrapper also supports the onError, onOpen, and onClose callbacks.
Vue 3
Next.js
The component renders a 3D scene and accesses browser APIs, so it must be loaded client-side only:
Vanilla JavaScript
Configuration
Required props
apiKey(string): Your avatar's API keyavatarId(string): The avatar ID to use
Common optional props
toggler(boolean, defaulttrue): Show the floating toggler widget; setfalseto render embeddedcompact(boolean, defaultfalse): Compact layout without header/footeroverlay(boolean,sentifyd-realtimeonly): Frameless, transparent overlay mode sized by your own CSSbrandName/brandLogo(string): Branding shown in the widget headertermsHref/privacyHref(string): Links to your terms and privacy pagesenableCaptions(boolean): Show live captions
The full attribute surface of the underlying web components (UI language, sizing, barge-in, consent injection, etc.) is documented in the Avatar Web Components Reference.
Styling
Customize the widget with CSS custom properties:
TypeScript Support
Both packages ship full TypeScript definitions:
API Reference
registerSentifydBot()— Registers the web component globally. Call once before using the<sentifyd-bot>element (e.g., in Vue or vanilla setups).createSentifydBot(config)— Programmatically creates and mounts a bot instance. Returns theHTMLElement.initializeStorage(storage)— Configures a custom storage adapter (getItem/setItem/removeItem) for mobile apps or special environments.
For sentifyd-realtime, the equivalents are registerSentifydRealtime() and createSentifydRealtime(config).