v0.2.0 — identity is required
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.
identifyUserfields acceptnullto clear a key — previously the type didn't allow it. An absent key still means "leave what was set", soidentifyUser({ id })after a workspace switch keeps the oldorg.id.
Migrating from 0.1.x: add user to your startRum call. Keep identifyUser for changes after startup.