The Chatbot is available through our CDN as a single JavaScript file or through NPM as a React component package.
HTML
React
<script type="module">import Chatbox from 'https://cdn.sonian.ai/embeded/latest/chatbox/index.js';Chatbox.initBubble({agentId: 'YOUR_AGENT_ID',});</script>
Attributes / Props
HTML
React
<script type="module">import Chatbox from 'https://cdn.sonian.ai/embeded/latest/chatbox/index.js';Chatbox.initBubble({agentId: 'YOUR_AGENT_ID',// If provided will create a contact for the user and link it to the conversationcontact: {firstName: 'John',lastName: 'Doe',email: 'customer@email.com',phoneNumber: '+33612345644',userId: '42424242',},// Override initial messagesinitialMessages: ['Hello Aian how are you doing today?','How can I help you ?',],// Provided context will be appended to the Agent system promptcontext: "The user you are talking to is John. Start by Greeting him by his name.",});</script>
string
required
ID of the Agent
string
Show properties
string
First name
string
Last name
string
Email
string
Phone number
string
Custom user ID
string array
Initial Agent messages
string
Extra context that will be appended to the Agent system prompt