Skip to content

Commit

Permalink
Sprig set user email (#438)
Browse files Browse the repository at this point in the history
  • Loading branch information
Winston-Hsiao authored Oct 2, 2024
1 parent 12fac08 commit 360498c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion frontend/src/components/SprigInitializer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ const SprigInitializer = () => {
if (window.Sprig && typeof window.Sprig === "function") {
console.log("Sprig initialized");

// Set user ID if authenticated
// Set user ID and email in Sprig if user is authenticated
if (isAuthenticated && currentUser) {
window.Sprig("setUserId", currentUser.id);
window.Sprig("setUserEmail", currentUser.email);
}

// Track page view
Expand Down

0 comments on commit 360498c

Please sign in to comment.