Login users and collect their feedback
When your user logs in, tell VibeReview who they are:
1function App() {
2 const { login } = useVibeReview();
3
4 const handleLogin = async (email, password) => {
5 // Your login logic
6 const user = await yourAuth.login(email, password);
7
8 // Tell VibeReview
9 login(user.id);
10 };
11
12 return <LoginForm onSubmit={handleLogin} />;
13}Example: Ask for feedback after exporting a PDF
1function ExportButton() {
2 const { review } = useVibeReview();
3
4 const handleExport = async () => {
5 await exportToPDF(); // Your export logic
6
7 // ⨠That's it! Beautiful widget appears
8 await review('export-pdf');
9 };
10
11 return (
12 <button onClick={handleExport}>
13 đ Export to PDF
14 </button>
15 );
16}1function LogoutButton() {
2 const { logout } = useVibeReview();
3
4 const handleLogout = () => {
5 yourAuth.logout();
6 logout(); // Tell VibeReview too
7 };
8
9 return <button onClick={handleLogout}>Log out</button>;
10}