Verba LogoDocs

Plain JavaScript Integration

For projects not using a framework, you can initialize the widget directly.

NOTE: targetElement is optional. If not provided, a floating widget will appear by default in the bottom-right corner.

Using npm

javascript
import { VerbaChat } from '@verba-ai/chat-sdk'

const chat = new VerbaChat({
    tagId: 'YOUR_TAG_ID',
    targetElement: '#chat-container',
    theme: 'light',
})

chat.init()

// To remove the widget later:
// chat.destroy()

Using CDN

If you prefer to include the SDK via a script tag, you can use a CDN.

html
<div id="chat-container"></div>

<script src="https://cdn.jsdelivr.net/npm/@verba-ai/chat-sdk@latest/dist/chat-sdk.umd.cjs"></script>
<script>
    const chat = new VerbaChat({
        tagId: 'YOUR_TAG_ID',
        targetElement: '#chat-container',
        theme: 'light',
    })

    chat.init()
</script>