How to use the logrocket.identify function in logrocket

To help you get started, we’ve selected a few logrocket examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github LessWrong2 / Lesswrong2 / packages / lesswrong / client / ga.js View on Github external
const identifyLogRocketCallback = (currentUser) => {
  const logRocketKey = getSetting('logRocket.apiKey')
  if (!logRocketKey) return

  LogRocket.init(logRocketKey)
  const { karma = 0, afKarma = 0, frontpagePostCount = 0, voteCount = 0, createdAt, username, displayName: lWDisplayName } = currentUser
  const additionalData = { karma, afKarma, frontpagePostCount, voteCount, createdAt, username, lWDisplayName }
  LogRocket.identify(currentUser._id, {
    // Don't show user display names by default
    displayName: currentUser._id,
    email: currentUser.email,
    // Custom LessWrong variables
    ...additionalData
  })
}
github dreamnettech / dreamtime / src / modules / services / logrocket.js View on Github external
async setup() {
    if (!this.can) {
      return
    }

    try {
      LogRocket.init(this.accessToken, this.config)
      LogRocket.identify(settings.user || 'unknown', {
        settings: settings.payload,
      })

      this.service = LogRocket
      this.enabled = true

      logger.info('LogRocket enabled!')
      logger.debug(this.accessToken)
    } catch (err) {
      logger.warn('LogRocket setup failed!', err)
    }
  }
}
github rlesniak / tind3r.com / src / routes / Logged / Logged.js View on Github external
getToken((tkn) => {
        window.Bugsnag.user = {
          id: currentUser._id,
          tkn: tkn || 'null',
        };

        if (window.hj && tkn) {
          window.hj('tagRecording', ['TKN', tkn]);
        }
      });
    }

    if (currentUser.gender === 0 && navigator.language.toLowerCase().indexOf('pl') > -1) {
      LogRocket.init('cqjmsx/tind3r');

      LogRocket.identify(currentUser._id, {
        name: currentUser.name,
        gender: currentUser.gender,
      });
    }

    matchStore.setCurrentUserId(currentUser._id);

    window.onfocus = n => n;

    window.ms = matchStore;
  }
github GraphQLGuide / guide / src / lib / withAuth.js View on Github external
associateToken()
      const { id, name, email, hasPurchased } = currentUser
      const userData = {
        name,
        email,
        hasPurchased
      }

      window.heap.identify(id, 'ID')
      window.heap.addUserProperties(userData)
      ReactGA.set({
        id,
        ...userData
      })
      LogRocket.identify(id, userData)

      this.lastCurrentUser = currentUser
    }
github OperationCode / front-end / pages / _app.js View on Github external
Fingerprint2.get(components => {
    const fingerprint = hash(components);
    LogRocket.identify(fingerprint);
  });
};
github jitsucom / jitsu / configurator / frontend / src / lib / services / analytics.ts View on Github external
public onUserKnown(userProps?: UserProps) {
    if (!userProps) {
      return;
    }
    this.user = userProps;
    this.ensureLogRocketInitialized();
    if (this.appConfig.rawConfig.keys.logrocket) {
      LogRocket.identify(userProps.uid, {
        email: userProps.email
      });
    }
    if (this.jitsu) {
      this.jitsu.id(this.getJitsuIdPayload(userProps));
    }
    if (this.appConfig.rawConfig.keys.intercom) {
      initIntercom(this.appConfig.rawConfig.keys.intercom, {
        email: userProps.email,
        name: userProps.name,
        user_id: userProps.uid
      });
    }

  }
github NoQuarterTeam / split / packages / web / src / components / providers / StateProvider.tsx View on Github external
const StateProvider: FC = ({ children }) => {
  const { user, userLoading } = useMe()
  const { group, getGroupLoading } = useGetGroup()

  if (user && production) {
    LogRocket.identify(user.id, {
      name: user.firstName + " " + user.lastName,
      email: user.email,
    })
  }
  return (
    
      {children}
    
  )
}
github NoQuarterTeam / split / packages / web / src / components / LoginForm.tsx View on Github external
update: (cache, res) => {
      if (res.data) {
        LogRocket.identify(res.data.login.id, {
          name: res.data.login.firstName + " " + res.data.login.lastName,
          email: res.data.login.email,
        })
        const me = res.data.login
        cache.writeQuery({ query: ME, data: { me } })
      }
    },
  })
github wearekickback / app / src / api / logRocket.js View on Github external
export const identify = profile => {
  if (LOGROCKET_TOKEN) {
    LogRocket.identify(profile.address, {
      name: profile.username || 'Unknown'
    })
  }
}

logrocket

JavaScript SDK for [LogRocket](https://logrocket.com/)

MIT
Latest version published 3 months ago

Package Health Score

68 / 100
Full package analysis