Documentation

Embed

Embed a Boarbs board inside your application with an iframe and server-created sessions.

Embedding lets you keep users inside your product while still using Boarbs for feedback collection, voting, and discussion.

How Embed Works

  1. Your backend creates an embed session with an organization API key
  2. Boarbs returns a signed embedUrl
  3. Your frontend renders that URL inside an <iframe>

1. Create an Organization API Key

Go to Settings → API and create an organization-scoped API key.

Use a read-write key if your integration needs to create embed sessions.

BOARBS_API_KEY=sk_...
BOARBS_BOARD_ID=your_board_id

2. Create an Embed Session on Your Backend

Never create embed sessions from client-side code. Keep your API key on the server.

const response = await fetch("https://YOUR_BOARBS_DOMAIN/api/embed/sessions", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.BOARBS_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    boardId: process.env.BOARBS_BOARD_ID, // optional, but recommended when you have multiple public boards
    userId: user.id,
    email: user.email,
    firstName: user.firstName,
    lastName: user.lastName,
    avatarUrl: user.avatarUrl,
    company: { id: "account-123", name: "Acme Inc." },
    mrr: { amount: 149.99, currency: "USD" },
    plan: user.plan,
    metadata: {
      accountId: user.accountId,
    },
    expiresInSeconds: 604800,
  }),
});

const { embedUrl, sessionToken, portalLoginUrl } = await response.json();

portalLoginUrl is the hosted portal with ?sso= already attached. Use it when a user should leave the iframe and continue on your-workspace.boarbs.com as the same person. The token is the same sessionToken the widget and iframe already use.

YOUR_BOARBS_DOMAIN is the domain where Boarbs itself is running. It is not the page in your app that will contain the iframe. On Boarbs Cloud this is usually a Boarbs-hosted workspace URL such as acme.boarbs.com. On self-hosted setups it is your own Boarbs domain.

Request Fields

FieldRequiredDescription
boardIdNoThe board to render in the iframe. If omitted, Boarbs uses the first public board in the API key's organization.
userIdNoYour internal user identifier
emailNoThe user's email address
firstNameNoFirst name shown inside Boarbs
lastNameNoLast name shown inside Boarbs
avatarUrlNoUser avatar URL
planNoPlan label you want to pass into the session
metadataNoArbitrary key-value data
expiresInSecondsNoSession lifetime in seconds, default 2592000 (30 days)

The board must either be public or belong to the same organization as the API key. If you omit boardId, the fallback only considers public boards.

Identity Behavior

When you pass both userId and email, Boarbs treats userId as the primary identity and uses email as a fallback.

That means:

  • use a stable userId from your own system whenever possible
  • keep sending email as well when you have it, especially for compatibility and notifications
  • do not rely on email alone if your users can change their address later

For returning users, send the same userId again when you create a new embed session. This keeps actions such as existing votes tied to the same person even if their email changes.

avatarUrl is optional. If you pass it, Boarbs can show the user's avatar in identified embed and widget experiences. If privacy is a concern, prefer a first-party or proxied image URL instead of a third-party avatar host.

Creating an embed session does not create a portal sign-in account by itself. To log that same person into the hosted portal, send them to portalLoginUrl or add ?sso=SESSION_TOKEN to a portal link. See Automatic Login.

3. Render the Iframe on the Frontend

<iframe
  src="EMBED_URL_FROM_BACKEND"
  width="100%"
  height="700"
  frameborder="0"
  title="Feedback"
></iframe>

React Example

"use client";

import { useEffect, useState } from "react";

export function FeedbackEmbed() {
  const [embedUrl, setEmbedUrl] = useState<string | null>(null);

  useEffect(() => {
    fetch("/api/feedback-embed-url")
      .then((response) => response.json())
      .then((data) => setEmbedUrl(data.embedUrl));
  }, []);

  if (!embedUrl) {
    return <div>Loading feedback…</div>;
  }

  return (
    <iframe
      src={embedUrl}
      width="100%"
      height="700"
      frameBorder="0"
      title="Feedback"
    />
  );
}

Optional URL Parameters

You can pass filters on the embed URL, for example:

https://YOUR_BOARBS_DOMAIN/embed?token=TOKEN&status=planned&sortBy=mostVoted&search=dark+mode

Common parameters include:

  • status
  • search
  • sortBy
  • tags

Security Notes

  • never expose your Boarbs API key in browser code
  • treat embed session URLs like credentials
  • use HTTPS in production
  • set a shorter expiresInSeconds value if you want tighter session control

Note on the API Explorer

The embed session flow exists as an API integration, but it is not currently part of the public explorer at /api/docs.

Use the API guide for the integration model, and use this page for the actual embed session workflow.

When to Use Embed

Embed is a good fit when:

  • your product already has authentication
  • you want feedback to live inside your app
  • you want to pass user identity from your own backend

If you want the fastest no-code launch, use the Portal instead.

Next Steps

  • Automatic Login — Log the same embed user into the hosted portal
  • Portal — Use the hosted feedback portal instead of embedding
  • Permissions and Visibility — Understand how embed access differs from portal access
  • Troubleshooting — Debug session scope, permissions, and silent failures
  • API — Understand what the explorer covers and where embed fits outside it
  • Getting Started — Review the default workspace setup first

Company and monthly recurring revenue

POST /api/embed/sessions accepts optional company and mrr objects:

  • company.name is required when company is supplied; company.id is optional. Both must be strings of 1–200 characters.
  • mrr.amount must be a finite number from 0 to 1000000000, with at most two decimal places. mrr.currency is an uppercase ISO-4217 currency code and defaults to USD.
  • Invalid values return HTTP 400. Unknown properties inside either object are rejected. Null is not an omission.

Company and MRR are team-only: workspace members see them in the portal users list and beside post authors and voters. Public portals, widget post details, comments, votes, and browser-facing session responses do not include them. Keep the API key and this customer context on your backend.

Customer profile sync requires email. Identity-only sessions keep their existing behavior. Immediately after an embed session is created with company or mrr, Boarbs attempts one server-side customer sync. Page loads, widget identification, navigations, and refreshes do not repeat it. Automatic login continues to sync the stored customer context. A supplied company or MRR replaces that person's existing value in this workspace. Omitting either object preserves its existing value. A company supplied without id replaces the name and clears the previous company ID. Zero MRR is a supplied value. Amounts are stored as integer hundredths of the currency unit and formatted for the workspace viewer's locale; no currency conversion is performed. Session-creation sync skips workspace members and does not create a login cookie or grant workspace membership. If that sync fails, Boarbs logs a generic message without the payload and still returns the session. Automatic login can sync the stored context later.

Boarbs© 2026 Boarbs