React frameworks
✓ 2 minutes setup
Easy

FeedbackJar + React

FeedbackJar integrates with React via a script tag in your HTML entry point or a custom hook. Works with Create React App, Vite, and any React setup.

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

How to install FeedbackJar in React

1

Get your Widget ID

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

Option A — Script tag in public/index.html

html
<!-- public/index.html — before </body> -->
<script src="https://cdn.feedbackjar.com/sdk.js"></script>
<script>
  window.fj.init('YOUR_WIDGET_ID');
</script>

Simplest option. Works for CRA, Vite, and any React setup.

3

Option B — Custom hook (Vite / no index.html access)

tsx
// hooks/useFeedbackJar.ts
import { useEffect } from 'react';

export function useFeedbackJar(widgetId: string) {
  useEffect(() => {
    const script = document.createElement('script');
    script.src = 'https://cdn.feedbackjar.com/sdk.js';
    script.async = true;
    document.body.appendChild(script);
    script.onload = () => window.fj.init(widgetId);
    return () => { if (window.fj) window.fj.destroy(); };
  }, [widgetId]);
}

// App.tsx
import { useFeedbackJar } from './hooks/useFeedbackJar';

function App() {
  useFeedbackJar(import.meta.env.VITE_FEEDBACKJAR_ID);
  return <div>...</div>;
}
4

Identify logged-in users (optional)

tsx
import { useEffect } from 'react';

function App() {
  const { user } = useAuth(); // your auth hook

  useEffect(() => {
    if (user && window.fj) {
      window.fj.identify({
        id: user.id,
        email: user.email,
        firstName: user.firstName,
      });
    }
  }, [user]);

  return <div>...</div>;
}

What you get

  • Script tag or custom hook — your choice
  • Works with CRA, Vite, and any React setup
  • Custom trigger support
  • User identification via useEffect
  • TypeScript types included
  • Cleanup on component unmount

Add feedback to your React app today

Sign up free, grab your Widget ID, and have the feedback widget running in your React 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 React docs →