about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/lib/analytics.web.tsx1
-rw-r--r--src/view/com/login/CreateAccount.tsx8
2 files changed, 8 insertions, 1 deletions
diff --git a/src/lib/analytics.web.tsx b/src/lib/analytics.web.tsx
index e2db537f4..10488c303 100644
--- a/src/lib/analytics.web.tsx
+++ b/src/lib/analytics.web.tsx
@@ -5,6 +5,7 @@ import {RootStoreModel} from 'state/models/root-store'
 const _analytics = {
   screen(_name: string) {},
   track(_name: string, _opts: any) {},
+  identify(_userId: string, _userTraits: any) {},
 }
 export const track = _analytics.track
 export function useAnalytics() {
diff --git a/src/view/com/login/CreateAccount.tsx b/src/view/com/login/CreateAccount.tsx
index 870013f3b..28a432e82 100644
--- a/src/view/com/login/CreateAccount.tsx
+++ b/src/view/com/login/CreateAccount.tsx
@@ -15,6 +15,7 @@ import {
 } from '@fortawesome/react-native-fontawesome'
 import {ComAtprotoAccountCreate} from '@atproto/api'
 import * as EmailValidator from 'email-validator'
+import {sha256} from 'js-sha256'
 import {useAnalytics} from 'lib/analytics'
 import {LogoTextHero} from './Logo'
 import {Picker} from '../util/Picker'
@@ -29,7 +30,7 @@ import {usePalette} from 'lib/hooks/usePalette'
 import {cleanError} from 'lib/strings/errors'
 
 export const CreateAccount = ({onPressBack}: {onPressBack: () => void}) => {
-  const {track, screen} = useAnalytics()
+  const {track, screen, identify} = useAnalytics()
   const pal = usePalette('default')
   const store = useStores()
   const [isProcessing, setIsProcessing] = useState<boolean>(false)
@@ -114,6 +115,11 @@ export const CreateAccount = ({onPressBack}: {onPressBack: () => void}) => {
         password,
         inviteCode,
       })
+
+      const email_hashed = sha256(email)
+      identify(email_hashed, {email_hashed})
+      console.log('identify', email_hashed)
+
       track('Create Account')
     } catch (e: any) {
       let errMsg = e.toString()