Iframe Embed
Embed the JotReview board directly inside your application.
Basic setup
The embed mode renders your full JotReview board inline inside any element on your page, without a floating button or overlay panel. This is ideal for dedicated feedback pages inside your application.
First, add a container element where the embed should appear:
Then initialize the SDK and call embed():
window.uj.embed({
container: '#jotreview-embed',
theme: 'auto',
navbar: true,
});
`
Initialize inside onReady
If you need to pass dynamic data (like the current user's identity) before rendering the embed, initialize inside the onReady callback to ensure the SDK is fully loaded:
// Then mount the embed
window.uj.embed({
container: '#jotreview-embed',
path: '/roadmap',
});
},
});
`
Configuration options
Full reference for the embed() options object:
| Option | Type | Default | Description | ||
|---|---|---|---|---|---|
container | `HTMLElement \ | string` | — | Required. Target element or CSS selector | |
path | string | '/' | Initial route to load (e.g. '/roadmap', '/updates') | ||
theme | `'light' \ | 'dark' \ | 'auto'` | 'auto' | Color theme |
navbar | boolean | true | Show or hide the board's internal navigation bar | ||
basePath | string | undefined | Path prefix in your app (for URL syncing, see below) | ||
onReady | (ctrl) => void | undefined | Fires once the embed is mounted | ||
onError | (err) => void | undefined | Fires if the embed fails to load |
Example with all options:
URL syncing with basePath
When a user navigates within the embedded board (e.g., from Feedback to Roadmap), you can keep your app's URL in sync by providing a basePath.
For example, if your app hosts the embed at /app/feedback, set:
The SDK will push navigation events to the browser's history API:
- /app/feedback/ — Feedback tab
- /app/feedback/roadmap — Roadmap tab
- /app/feedback/updates — Updates tab
On page load, the embed reads the current URL and restores the correct tab automatically.
User authentication in embed
Identify users before or after mounting the embed. If you call identify() after the embed is already mounted, it will update the session in place without a full reload.
// Or update identity after the user logs in authButton.addEventListener('click', async () => { const user = await loginUser(); window.uj.identify({ id: user.id, email: user.email }); });
// Log out
logoutButton.addEventListener('click', () => {
window.uj.identify(null); // Returns to anonymous mode
});
`
Server configuration for catch-all routes
If you are using URL syncing with basePath, your server must serve the same page for all sub-paths under the base path. Otherwise, a direct visit to /app/feedback/roadmap will return a 404.
Next.js App Router — Create a catch-all route:
Vite / React Router — Add a wildcard route:
const routes = [
{ path: '/app/feedback/*', element: <FeedbackPage /> },
];
`
Express — Serve your SPA for all sub-paths: