Skip to main content
@gleanfeed/react wraps the browser widget with a provider and hook. Use it in React 18 or 19 apps, including Next.js App Router projects.

Install the packages

Install both the React wrapper and its widget dependency:

Add the provider

Create a client component near the root of your app. The package can be imported during server rendering, but the provider initializes the widget after the browser mounts it.
The provider accepts the same configuration as init(). Unmounting it removes the launcher, iframe, event listeners, and notification polling. React Strict Mode remounts do not leave duplicate widget instances.

Open and close the widget

Call the hook from a client component below the provider:
You can also call open("feedback" | "roadmap" | "changelog") when a single component needs to choose the view dynamically.

Pass signed customer identity

Generate the signature on your server. Never import the widget secret into a client component or expose it through a NEXT_PUBLIC_... environment variable.
Follow the identity signing contract, then pass only the signed GleanFeedUser object from your server component to FeedbackProvider. If the signed-in customer changes without remounting the provider, reidentify them from a client component:
Prefer passing user to GleanFeedProvider; use identify() when your app changes customers while the provider stays mounted.

Compatibility

The wrapper supports React 18.2 and React 19 and depends on a compatible @gleanfeed/widget. During 0.x, pin exact versions when upgrades require a controlled test window. Review the full version and compatibility policy.