add identify

This commit is contained in:
Barak Gila 2022-09-26 14:02:28 -07:00
parent 025a054b9e
commit 4abedf0c64

View File

@ -64,10 +64,14 @@ export const withTracking =
export async function identifyUser(userId: string) {
setUserId(userId)
// @ts-expect-error Sprig doesn't yet have a native typescript snippet
window.Sprig.setUserId(userId)
}
export async function setUserProperty(property: string, value: string) {
const identifyObj = new Identify()
identifyObj.set(property, value)
await identify(identifyObj)
// @ts-expect-error Sprig doesn't yet have a native typescript snippet
window.Sprig.setAttribute(property, value)
}