Install: Next.js

Add the feedback widget
to a Next.js app.

The App Router splits your tree into server and client components. The widget belongs in one client provider at the root, so every route shares one instance.

One client boundary Survives navigation Server-minted token
App Router
app/
app/
  layout.tsx          server, wraps children
  feeblo-provider.tsx client, owns widget
  feedback-button.tsx client, opens widget

<html><body>
  <FeebloWidgetProvider>
    {children}
  </FeebloWidgetProvider>
</body></html>
1Client provider file
2Provider in the root layout
3Hooks in client components

Server components stay server components. Only the provider and the buttons are client code.

Prerequisites

Before you start

The App Router

This guide uses the app directory, a root layout, and client components. The Pages Router setup matches the React guide instead.

React 19 or newer

The React bindings declare react and react-dom ^19.0.0 as peer dependencies. Check your Next.js version's React release before you start.

Your organization ID

Copy it from Settings → Widget → Installation. The provider takes it as a required organizationId prop.

A way to read the current user

Your layout or a server component needs the signed-in user's id, email, and name to pass down.

Steps

Add the widget to the App Router

The order matters. The client provider exists before the layout imports it, and the layout exists before any page calls the hooks.

  1. 1

    Install the packages

    Install the React bindings with the core SDK. Both are ESM packages with no runtime dependencies.

    Terminal
    npm install @feeblo/sdk @feeblo/sdk-react
  2. 2

    Create a client provider component

    Add use client to the top of a new file. The provider runs effects, so it has to be a Client Component.

    app/feeblo-provider.tsx
    "use client";
    
    import { FeebloProvider, type UserIdentity } from "@feeblo/sdk-react";
    import type { ReactNode } from "react";
    
    export function FeebloWidgetProvider({
      children,
      user,
    }: {
      children: ReactNode;
      user?: UserIdentity;
    }) {
      return (
        <FeebloProvider organizationId="org_123" placement="bottom-right" user={user}>
          {children}
        </FeebloProvider>
      );
    }
  3. 3

    Wrap the root layout

    Render the provider inside body in app/layout.tsx. The root layout stays mounted across route changes, so the widget mounts once. If your app already has a providers file, nest FeebloWidgetProvider inside it rather than adding a second wrapper.

    app/layout.tsx
    import type { ReactNode } from "react";
    import { FeebloWidgetProvider } from "./feeblo-provider";
    
    export default function RootLayout({ children }: { children: ReactNode }) {
      return (
        <html lang="en">
          <body>
            <FeebloWidgetProvider>{children}</FeebloWidgetProvider>
          </body>
        </html>
      );
    }
  4. 4

    Add a trigger in a client component

    The useFeeblo hook only works below the provider and inside a client component. Add use client to any file that calls it.

    app/feedback-button.tsx
    "use client";
    
    import { useFeeblo } from "@feeblo/sdk-react";
    
    export function FeedbackButton() {
      const feeblo = useFeeblo();
    
      return (
        <button type="button" onClick={() => feeblo.open()}>
          Give feedback
        </button>
      );
    }
  5. 5

    Pass the user from the server

    Read the session in the layout and pass plain values to the provider. A new user object calls identify on the live widget without remounting it. The values below come from your auth setup; only id is required.

    app/layout.tsx
    <FeebloWidgetProvider
      user={{ id: user.id, email: user.email, name: user.name }}
    >
      {children}
    </FeebloWidgetProvider>
  6. 6

    Mint a token on the server when you need one

    A signed token proves the identity. Sign a JWT on your server with your organization secret and the claims the widget expects, then pass it as token alongside the id. The browser never sees the secret. Widget SSO documents the claims and the signing call.

  7. 7

    Confirm the widget loaded

    Add debug to the provider for the first run. The SDK prints a banner with the org ID and base URL, then every trigger binding and event.

    app/feeblo-provider.tsx
    <FeebloProvider organizationId="org_123" debug user={user}>
      {children}
    </FeebloProvider>

Result

What you should see

A launcher on every route

The provider sits in the root layout, so the launcher appears on every page without repeating the component.

No remount on client navigation

Layouts persist across App Router navigation. Moving between pages keeps the same widget instance and the same identified user.

The widget mounts after hydration

The provider initializes in an effect, so the server-rendered HTML arrives first and the launcher appears once React takes over.

Posts carry the server identity

A submission lands on the board with the id, email, and name your layout passed down, plus a verified contact when you send a token.

App Router rules that matter

Four boundaries decide whether the widget mounts correctly.

use client on the provider file

The provider uses state and effects. Server Components cannot run them.

Provider in app/layout.tsx

Layouts persist. A provider inside a page unmounts on the next navigation.

Plain values across the boundary

Props passed from a Server Component must serialize. Send strings, numbers, and booleans.

Secret stays on the server

Sign the identity token in a route handler or server action and pass only the token.

Common problems

Each of these comes from the server and client split, not from the widget.

The hook only works in a Client Component

Next.js refuses the import. Add use client to the file that renders the provider.

The widget remounts on navigation

The provider lives in a page, not the layout. Move it up to app/layout.tsx.

useFeeblo throws on the server

The hook ran during server rendering. Call it in a Client Component that renders only in the browser tree.

Two widgets fight

The layout loads the CDN script and the provider. Remove the script tag. One page, one integration path.

Where each file sits

Only two files carry the client boundary. Pages stay server components.

The provider accepts every widget option as a prop, so mode, modules, theme, locale, and defaultBoard live on the same component. Set them once in the client file.

app/layout.tsxServer ComponentReads the session and renders the provider around children.
app/feeblo-provider.tsxClient ComponentOwns the widget and passes organizationId and config props.
app/feedback-button.tsxClient ComponentCalls useFeeblo to open the widget.
app/page.tsxServer ComponentRenders the button. No widget code needed.

Start building what your users want

Open-source feedback boards, roadmaps, and changelogs. Self-host in minutes or start on the cloud, and close the loop with every release.