Floating Initial Messages
Show the agent's initial message above the ChatDrift floating launcher.
Floating Initial Messages
Floating initial messages show your agent's configured initial message above the closed floating launcher. Use them to welcome visitors before they open the agent.
Prerequisites
- A ChatDrift agent with an Initial Messages value configured in the dashboard.
- The floating launcher integration, either
<nexvio-widget>withagent.jsor<nexvio-chat-bot>from@nexvio-ai/widget-js.
This feature does not apply to direct embedded <nexvio-agent> usage because direct embeds do not have a launcher surface.
Script Tag Integration
Set window.nexvioConfig before loading agent.js.
<script>
window.nexvioConfig = {
showFloatingInitialMessages: true,
floatingInitialMessagesDelay: 2,
floatingMessagesOncePerSession: true
}
</script>
<script src="https://app.nexvio.ai/api/agent.js" async></script>
<nexvio-widget id="pk_..."></nexvio-widget>
React Integration
import { NexvioChatbot } from "@nexvio-ai/widget-js/react"
export function SupportChat() {
return (
<NexvioChatbot
options={{
publicKey: "pk_...",
showFloatingInitialMessages: true,
floatingInitialMessagesDelay: 2,
floatingMessagesOncePerSession: true,
}}
/>
)
}
Programmatic SDK Integration
import "@nexvio-ai/widget-js"
const chatbot = document.createElement("nexvio-chat-bot")
chatbot.setOptions({
publicKey: "pk_...",
showFloatingInitialMessages: true,
floatingInitialMessagesDelay: 2,
floatingMessagesOncePerSession: true,
})
document.body.append(chatbot)
Configuration Reference
| Option | Type | Default | Description |
|---|---|---|---|
showFloatingInitialMessages | boolean | false | Enables floating initial messages above the closed launcher. |
floatingInitialMessagesDelay | number | 2 | Delay in seconds before the floating message appears. Use 0 for immediate display. |
floatingMessagesOncePerSession | boolean | true | When enabled, the message appears only once per browser session for each public key. |
Behavior Notes
- The message text comes from the agent's dashboard Initial Messages field.
- Multiple non-empty lines are shown as separate floating message bubbles.
- Opening the widget or dismissing the floating message hides it for the current page load.
- With
floatingMessagesOncePerSession: true, the dismissed/opened state is stored insessionStorageand scoped by widget public key. - If browser storage is unavailable, the message can still show once per page load.
Troubleshooting
- No message appears if the agent has no Initial Messages value.
- For script-tag embeds,
window.nexvioConfigmust be defined beforeagent.jsloads. - This only works with the floating launcher. Use
<nexvio-chat-bot>or the<nexvio-widget>auto-launcher script integration.