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 Button (Default)

A small button appears in the bottom-right corner. Clicking it opens a slide-out panel where users can browse features, vote, comment, and submit new requests.

<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. 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-projectYesYour project API key from the dashboard
data-modeNo"floating""floating" for button + panel, "inline" for embedded
data-targetNoCSS selector for the container element (inline mode only)
data-themeNo"auto""auto" (matches system), "light", or "dark"

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 the iOS app — results appear in your admin dashboard instantly.

Rate Limits

The widget shares the same rate limits as the iOS 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 Enterprise 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.