-
Notifications
You must be signed in to change notification settings - Fork 19
Open
Description
I tried 2 approaches below but still encountered the same issue. May I know how to resolve this issue?
- use @tawk.to/tawk-messenger-react,
const onLoad = () => {
console.log('Here', tawkMessengerRef);
tawkMessengerRef.current.setAttributes({
name: 'test',
email: '[email protected]',
});
};
- useeffect to check if authenticated
useEffect(() => {
if (isLoggedIn && store.user) {
// const hash = hashInBase64(store.user.email, window.TAWK_APIKEY);
if (window.Tawk_API) {
window.Tawk_API.setAttributes(
{
name: store.user.loginName ?? '',
email: store.user.email ?? '',
// hash: hash,
},
function (error) {
if (error) {
console.error('Tawk update user information error:', error);
}
},
);
}
}
}, [store.user]);
Metadata
Metadata
Assignees
Labels
No labels