React frameworks
✓ 2 minutes setup
Easy

FeedbackJar + Next.js

FeedbackJar works with both the Next.js App Router (13+) and Pages Router. Install once in your root layout and collect feedback across every page of your app.

Get your Widget ID free → 7-day free trial · No credit card required

How to install FeedbackJar in Next.js

1

Get your Widget ID

bash
# Sign up at app.feedbackjar.com
# Create a widget → copy your Widget ID

Your Widget ID looks like: wgt_abc123xyz

2

Add to your root layout (App Router)

tsx
// app/layout.tsx
import Script from 'next/script';

export default function RootLayout({ children }: { children: React.ReactNode }) {
  return (
    <html lang="en">
      <body>
        {children}
        <Script src="https://cdn.feedbackjar.com/sdk.js" strategy="afterInteractive" />
        <Script id="feedbackjar-init" strategy="afterInteractive">
          {`window.fj.init('${process.env.NEXT_PUBLIC_FEEDBACKJAR_ID}');`}
        </Script>
      </body>
    </html>
  );
}
3

Add your Widget ID to .env.local

bash
# .env.local
NEXT_PUBLIC_FEEDBACKJAR_ID=your_widget_id

Reload your dev server after adding the env variable.

4

Identify logged-in users (optional)

tsx
// components/FeedbackJarIdentify.tsx
'use client';
import { useEffect } from 'react';

export function FeedbackJarIdentify({ user }: { user: { id: string; email: string } }) {
  useEffect(() => {
    if (window.fj && user) {
      window.fj.identify({ id: user.id, email: user.email });
    }
  }, [user]);
  return null;
}

Attach user identity so feedback is linked to your user accounts.

What you get

  • Works with App Router and Pages Router
  • Uses next/script for optimized loading
  • Environment variable for the Widget ID
  • User identification with server components
  • Route-specific show/hide via usePathname
  • TypeScript types included

Add feedback to your Next.js app today

Sign up free, grab your Widget ID, and have the feedback widget running in your Next.js app in 2 minutes.

Start Free Trial 7-day free trial · No credit card required

Frequently Asked Questions

Looking for the full technical reference? Read the Next.js docs →