Skip to content

Web Channel

The web channel delivers your bot through the embeddable OmniBots widget on any website. It is the fastest channel to set up and supports the richest set of content types.

Setup

  1. Publish your bot (see Publishing)
  2. Go to your bot's Channels tab and select Web
  3. Copy the embed snippet
  4. Paste the snippet into your website's HTML
html
<link rel="stylesheet" href="https://omnibots-widget.web.app/widget.css">
<script src="https://omnibots-widget.web.app/widget.iife.js"></script>
<script>
  window.omnibot.init({
    deploymentKey: 'your-deployment-key'
  });
</script>
imageWeb channel configuration page showing embed snippet, session timeout setting, domain allowlist, and deployment key with copy button
Web channel configuration

TIP

For detailed installation options including framework integration and iframe methods, see the Web Widget Installation guide.

Session Management

Web widget sessions are managed automatically:

BehaviorDescription
Session creationA new session starts when the user opens the widget
PersistenceSessions persist across page navigations using localStorage
TimeoutSessions expire after 30 minutes of inactivity (configurable)
ResumeReturning users see their conversation history within the session window
Multi-tabSessions are shared across browser tabs on the same domain

Session Timeout Configuration

Session timeout is configured per-bot in the Operations Portal under Bot Settings > Web Channel. The default timeout is 30 minutes (1800 seconds). This setting is delivered to the widget from the server — it is not configurable in the embed code.

Page Context

Pass information from your website to the bot flow using the metadata init option or the setContext() API:

js
window.omnibot.init({
  deploymentKey: 'your-deployment-key',
  metadata: {
    page_label: 'billing',
    user_id: 'user_12345',
    user_tier: 'enterprise'
  }
});

// Update context dynamically (e.g., on SPA navigation)
window.omnibot.setContext({
  page_label: 'support',
  page_url: window.location.href
});

Context data is available as flow variables, enabling page-based KB routing, conditional logic, and personalized responses. See Widget Page Context for full details.

User Identification

By default, web users are anonymous. You can pass user identity via the metadata context for authenticated experiences:

js
window.omnibot.init({
  deploymentKey: 'your-deployment-key',
  metadata: {
    user_id: 'user_12345',
    user_name: 'Jane Doe',
    user_tier: 'enterprise',
    account_id: 'ACC-789'
  }
});

Identified users receive:

  • Personalized greetings using {{user_name}}
  • Context-aware tool calls and handoffs with pre-populated user data
  • Consistent conversation routing based on subscription tier

Domain Allowlisting

Restrict which domains can load your widget:

  1. Go to Bot Settings > Web Channel > Security
  2. Add allowed domains (e.g., example.com, *.example.com)
  3. Requests from unlisted domains will be rejected

WARNING

Always configure domain allowlisting for production deployments to prevent unauthorized use of your bot.

Analytics

Web channel conversations are tracked automatically in the Analytics Dashboard. Metrics include message count, session duration, containment rate, and user satisfaction.

OmniBots AI Bot Platform