Skip to Main Content

JavaScript Widget

Embed a feature voting board on any website with a single script tag. Works on WordPress, Shopify, static HTML, React, and any web platform.

Quick start

Add the following script tag to your website. Replace YOUR_API_KEY with your project's API key from the dashboard.

Floating launcher

Choose an icon or bring your own image. Click the preview button to open the panel, then copy your embed code. The launcher appears in the bottom-right corner of your website.

Icon
Shape
Theme default
Launcher preview
Embed code
<script
  src="https://featureportal.com/widget.js"
  data-project="YOUR_API_KEY"
></script>

Inline embed

Renders the feature board directly inside a specific element on your page. Launcher settings apply only to floating mode. Great for dedicated feedback pages.

<div id="featureportal"></div> <script src="https://featureportal.com/widget.js" data-project="YOUR_API_KEY" data-mode="inline" data-target="#featureportal" ></script>

Configuration

Configure the widget using data-* attributes on the script tag.

AttributeRequiredDefaultDescription
data-projectYes—Your project API key from the dashboard
data-modeNo"floating""floating" for button + panel, "inline" for embedded
data-targetNo—CSS selector for the container element (inline mode only)
data-themeNo"auto""auto" (matches system), "light", or "dark"
data-launcher-iconNobulbBuilt-in icon or fallback for a custom image. Choose bulb, portal, chat, or sparkles.
data-launcher-icon-urlNo—Custom image URL. Use an HTTP(S) URL or a path beginning with / on the embedding site.
data-launcher-shapeNocircleUse circle or rounded for a rounded square.
data-launcher-colorNoTheme colorButton background in six-digit hex, such as #176354. The built-in icon color adjusts for contrast.

JavaScript initialization

For manual setup, load widget.js without a data-project attribute and call FeaturePortal.init after the script loads.

FeaturePortal.init({
  project: "YOUR_API_KEY",
  launcher: {
    icon: "chat",
    iconUrl: "/images/feedback.svg",
    shape: "rounded",
    color: "#176354"
  }
})

Features

  • Browse features — Users can see all approved, in-progress, and completed features
  • Vote — One-click upvoting with instant feedback
  • Comment — Discuss features with other users and admins
  • Submit requests — Users can suggest new features directly
  • Search & filter — Filter by status or search by keyword
  • Dark mode — Automatic or manual theme support
  • Style isolation — Uses Shadow DOM so widget styles never conflict with your site
  • Persistent identity — Anonymous user ID stored in localStorage so votes persist across sessions

How it works

1
Script loads
The widget reads your API key and configuration from the script tag attributes.
2
Anonymous user created
A unique anonymous user ID is created and stored in localStorage. This allows votes to persist across sessions without requiring sign-up.
3
Features fetched
The widget fetches your project's features from the FeaturePortal API and renders them inside a Shadow DOM container, ensuring no CSS conflicts with your site.
4
Users interact
All interactions (votes, comments, submissions) use the same SDK API as iOS and Mac apps — results appear in your admin dashboard instantly.

Rate limits

The widget shares the same rate limits as the iOS and macOS SDK:

  • Read operations (fetching features, comments): 100 requests/minute per API key
  • Write operations (voting, commenting, submitting): 30 requests/minute per API key

Branding

On the Starter plan, the widget shows a "Powered by FeaturePortal" link at the bottom. Upgrade to Pro or Studio to remove it.

Troubleshooting

Widget doesn't appear
Check the browser console for errors. Ensure the data-project attribute contains a valid API key. For inline mode, verify the data-target selector matches an existing element.
Content Security Policy (CSP) errors
If your site uses a strict CSP, you may need to allow script-src featureportal.com and connect-src featureportal.com in your policy.
Votes not persisting
The widget stores the anonymous user ID in localStorage. In some environments (e.g., cross-origin iframes, private browsing), localStorage may be restricted. The widget still works but votes won't persist across page loads.