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.
# Sign up at app.feedbackjar.com
# Create a widget → copy your Widget ID <!-- 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.
// 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>;
} 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>;
} Sign up free, grab your Widget ID, and have the feedback widget running in your React app in 2 minutes.