Add the widget

Troubleshooting

Most integration issues are one of three things. Here's how to tell them apart.

Widget not appearing? Start here

Open your browser DevTools, go to the Network tab, filter for button.js, and reload. What you see tells you which of three problems you have:

  1. No button.js request at all. The widget is vendored or bundled inline — an old manual copy — instead of the CDN package. Switch to @featurefast/react (see the React guide) so it loads the live runtime from the CDN.
  2. The button.js request fails (red, “Provisional headers are shown”, a CSP issue in DevTools). CSP is blocking it. Add the two directives — script-src https://cdn.featurefast.ai and connect-src https://<your-deployment>.convex.site. See CSP setup.
  3. It loads but shows the OLD UI.That's the browser cache of the loader. Hard-reload (Cmd+Shift+R) or try incognito; it self-clears within about 5 minutes.

Anonymous vs authenticated

Marketing and static sites with no login must enable Allow anonymous submissions in Settings and should set Allowed origins. Authenticated apps compute customerHash = HMAC-SHA256(secretKey, customerId) (hex) server-side. Your projectId is public and safe to expose; the secret key (ff_sk_…) is server-only.

Error reference

These are the exact responses from POST /v1/prompts when a submission is rejected.

StatusErrorWhat it means
404Unknown projectThe projectIddoesn't exist — check for typos or a stale id.
403Origin not allowed for this projectThe request origin isn't in Allowed origins. Add it, or leave the list empty to allow any origin.
401customerHash is required for this projectAnonymous submissions are off and no hash was sent. Enable anonymous, or pass a customerHash.
401Invalid customerHashThe hash didn't verify. Recompute HMAC-SHA256(secretKey, customerId) with the right secret key.
400customerId is required when customerHash is providedYou sent a hash without the customerId it was computed from. Send both.

Note: an empty Allowed origins list means any origin is allowed.

How updates ship & cache

The npm package @featurefast/react is a tiny shell that injects https://cdn.featurefast.ai/button.js — a loader with a 5-minute cache — which in turn loads a content-hashed, immutable runtime. Widget UI changes ship from the CDN and reach every site within about 5 minutes. You do not republish your app or bump the package version to get them.

Still stuck? Email support@featurefast.ai with the failing button.js request and any console errors.