Widgets & EmbedsFloating Button

Floating Button

Add a floating feedback button to your website or app. Opens as a popup modal or a full-height sidebar panel. Choose your framework — Vanilla JS, React, Vue, or Angular — and paste in the code.

Overview

The floating button is the most popular embed type. A small button appears in the corner of every page. When a user clicks it, the widget opens as either a popup (modal overlay) or a sidebar (full-height slide-in panel). No layout changes required — it works on any page without touching your existing HTML.

Prerequisites

Before you start, grab your Organization ID from Settings > Widget & Embeds in your ProductBridge dashboard. It looks like da10975d-0faf-4c8b-b526-4a5038a4e4d5.

A floating button that opens a centered modal popup when clicked.

<!-- Paste before </body> -->
<script>
  (function () {
    var s = document.createElement('script');
    s.src = 'https://app.productbridge.io/sdk/pb-widget.js';
    s.async = true;
    s.onload = function () {
      ProductBridge.init({
        organizationId: 'YOUR_ORGANIZATION_ID',
        mode: 'popup',           // opens as modal (default)
        position: 'bottom-right',
        theme: 'auto',
        defaultTab: 'feedback',
        buttonColor: '#3B82F6',
        buttonText: 'Feedback',
      });
    };
    document.head.appendChild(s);
  })();
</script>

A floating button that slides in a full-height panel from the side when clicked.

<!-- Paste before </body> -->
<script>
  (function () {
    var s = document.createElement('script');
    s.src = 'https://app.productbridge.io/sdk/pb-widget.js';
    s.async = true;
    s.onload = function () {
      ProductBridge.init({
        organizationId: 'YOUR_ORGANIZATION_ID',
        mode: 'sidebar',         // slides in as a panel
        position: 'bottom-right',
        theme: 'auto',
        defaultTab: 'feedback',
        buttonColor: '#3B82F6',
        buttonText: 'Feedback',
      });
    };
    document.head.appendChild(s);
  })();
</script>

Configuration Options

OptionTypeDefaultDescription
organizationIdstringRequired. Your organization ID
modestringpopuppopup or sidebar
positionstringbottom-rightbottom-right, bottom-left, top-right, top-left
themestringautoauto, light, or dark
defaultTabstringfeedbackfeedback, roadmap, or changelog
buttonColorstring#3B82F6Hex color for the floating button
buttonTextstringFeedbackLabel on the floating button
userTokenstringJWT for automatic user identification — see Identity Verification
zIndexnumber999999CSS z-index for the overlay

Programmatic Control

You can open, close, or toggle the widget from your own code at any time:

// Open the widget
ProductBridge.open();

// Open directly to a specific tab
ProductBridge.open(); // defaultTab controls which tab shows

// Close the widget
ProductBridge.close();

// Toggle open / closed
ProductBridge.toggle();

// Identify a user after init (e.g. after login)
ProductBridge.identify('YOUR_JWT_TOKEN');

Use ProductBridge.open() and ProductBridge.close() to wire the widget to your own UI controls — header buttons, help menus, keyboard shortcuts, etc.

Identify Your Users

To link submitted feedback to your logged-in users, add Identity Verification. Generate a JWT on your backend and pass it as userToken:

ProductBridge.init({
  organizationId: 'YOUR_ORGANIZATION_ID',
  userToken: 'JWT_FROM_YOUR_SERVER', // signed with your Widget API secret
});

See the full guide → Identity Verification