Login users and collect their feedback
When your user logs in, tell ProofConvert who they are:
1function App() {
2 const { login } = useProofConvert();
3
4 const handleLogin = async (email, password) => {
5 // Your login logic
6 const user = await yourAuth.login(email, password);
7
8 // Tell ProofConvert
9 login(user.id, {
10 name: user.name, // Optional
11 email: user.email, // Optional
12 photoUrl: user.photoUrl // Optional
13 });
14 };
15
16 return <LoginForm onSubmit={handleLogin} />;
17}name, the user will appear as "Anonymous" in public reviews.Example: Ask for feedback after exporting a PDF
1function ExportButton() {
2 const { review } = useProofConvert();
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 } = useProofConvert();
3
4 const handleLogout = () => {
5 yourAuth.logout();
6 logout(); // Tell ProofConvert too
7 };
8
9 return <button onClick={handleLogout}>Log out</button>;
10}