A React component for integrating Aplisay's conversational AI into your web applications.
npm install aplisay-react-widget
import React from 'react';
import { AplisayWidget } from 'aplisay-react-widget';
function App() {
return (
<AplisayWidget
listenerId="YOUR_LISTENER_ID"
url="YOUR_APLISAY_URL"
roomKey="YOUR_ROOM_KEY"
verbose={true}
mode="light"
theme={{
palette: {
primary: { main: '#f63bcb' },
background: { default: '#ffffff' },
text: { primary: '#374151' },
error: { main: '#ef4444' }
}
}}
/>
);
}
Prop | Type | Required | Description |
---|---|---|---|
listenerId |
string | Yes | Your unique listener identifier |
url |
string | Yes | The Aplisay API endpoint URL |
roomKey |
string | Yes | Authentication key for the room |
verbose |
boolean | No | Enable detailed logging (default: false) |
mode |
'light' | 'dark' | No | Color scheme mode (default: 'light') |
theme |
ThemeObject | No | Custom theme configuration |
If you wish, the widget can be controlled by the open
prop, the setter will be called with the new state of the widget if it changes due to interaction from the user (pressing hangup, etc).
| open
| boolean | No | Whether the widget is active (default: true) |
| setOpen
| (open: boolean) => void | No | Function to set the widget's open/active state |
The theme object structure:
interface Theme {
palette: {
primary: {
main: string; // Primary color
};
background: {
default: string; // Background color
};
text: {
primary: string; // Text color
};
error?: {
main: string; // Error color
};
};
}
The widget can be in one of these states:
initial
parameter_error
join
connected
error
import { useAplisayRoom } from 'aplisay-react-widget';
TODO: DOCUMENT HOOK for those building their own widget.
For issues, feature requests, or questions, please just use this GitHub repository in the first instance.
MIT License, for any code written by Aplisay for this widget.