Skip to content

v0.2.0 — identity is required

Choose a tag to compare

@duci9y duci9y released this 13 Aug 18:34
· 2 commits to main since this release
9183bdf

Breaking: user is now a required option.

startRum({,
  user: async () => (await getSession())?.user ?? null,
});

Pass the person ({ id, email }), a resolver awaited once at startup, or the literal "anonymous" for an app with no sign-in. (await startRum(…)).identified tells you whether anyone was attached.

Identity used to be a second call you could forget, which is exactly what happened to us: a week of our own browser spans with nobody on them. RUM whose spans have no user answers "what happened on the site" and never "what did this person do".

Two smaller fixes that follow from it:

  • The first batch of spans waits up to three seconds for identity, so page-load spans carry the person too. The wait ends early on a settled identity or a page leaving, so it never costs telemetry.
  • identifyUser fields accept null to clear a key — previously the type didn't allow it. An absent key still means "leave what was set", so identifyUser({ id }) after a workspace switch keeps the old org.id.

Migrating from 0.1.x: add user to your startRum call. Keep identifyUser for changes after startup.