Embed Widget
The Pragence chat widget can run as a floating bubble, fill an element on your page, or open as a hosted full-page chat. Create a widget in the project console and copy its generated embed code. The widget key in that snippet identifies the configured widget; do not substitute a project ID or expose a secret API key.
Floating bubble
The generated bubble snippet sets window.pragenceChatSettings and loads the
widget bundle from your deployment's CDN. It resembles this:
<script>
window.pragenceChatSettings = { widgetKey: "YOUR_WIDGET_KEY" };
</script>
<script src="https://cdn.pragence.io/widget/v1/pragence-chat.js" async></script>Use the exact URL and key from the console because the CDN base can vary by
deployment. The widget is initialized from widgetKey; there is no public
data-project attribute in the current embed contract.
Inline and full-page layouts
The console can generate inline code that mounts the chat into a host element. Give that element a height, since the widget fills the available space:
<div id="pragence-chat" style="height: 640px"></div>
<script>
window.pragenceChatSettings = {
widgetKey: "YOUR_WIDGET_KEY",
layout: "inline",
container: "#pragence-chat"
};
</script>
<script src="https://cdn.pragence.io/widget/v1/pragence-chat.js" async></script>Each widget also has a hosted full-page URL available from its embed-code settings. The page uses the same widget key and does not need a host-site script.
Supported options
The script reads window.pragenceChatSettings. The runtime configuration
supports widgetKey (required), layout (bubble, inline or fullpage),
container (for inline layout), position (bottom-right, bottom-left,
top-right or top-left),
primaryColor, greeting, placeholder, autoOpen, autoOpenDelay,
language, dir, voice, userToken and userData. Voice appears only
when enabled in both widget configuration and the organization deployment.
Text, logo and other server-owned presentation settings come from the widget
configuration in the console. See the generated snippet for the settings that
are configured for your widget.
The widget uses Shadow DOM for style isolation and accepts the inherited CSS
custom properties --pragence-font, --pragence-primary,
--pragence-primary-hover and --pragence-primary-light. For widget fields,
callbacks and the event API, see Widget customization.