From e203b05c83d13e90ab9a6a1dd66c0f7c2d5dbf61 Mon Sep 17 00:00:00 2001 From: Amitava Saha Date: Sat, 29 Aug 2026 06:23:11 +0530 Subject: [PATCH 1/6] set rum user --- astro.config.mjs | 5 +- src/components/Header.astro | 3 + src/components/UserNav.astro | 132 ++++++++++++++++++ .../instrumentation-guide/sdk-reference.mdx | 6 +- .../docs/rum/instrumentation-guide/web.mdx | 12 +- 5 files changed, 151 insertions(+), 7 deletions(-) create mode 100644 src/components/UserNav.astro diff --git a/astro.config.mjs b/astro.config.mjs index 76e011be..7a5bee86 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -75,7 +75,8 @@ export default defineConfig({ // KloudMate RUM. `init` runs from `onload` so the bundle is fully executed // before it is called; the rolling /v2/ path picks up SDK patches without an // edit here. Session recording is off, so this collects page performance and - // errors only. + // errors only. The `km-rum-ready` event lets UserNav.astro attach the + // signed-in user's userId/userEmail even though this bundle loads async. head: [ { tag: 'script', @@ -91,7 +92,7 @@ export default defineConfig({ version: '', sampleRate: 1.0, sessionRecorder: { enabled: false }, - })`, + }); document.dispatchEvent(new Event('km-rum-ready'))`, }, }, ], diff --git a/src/components/Header.astro b/src/components/Header.astro index 27ce870a..dbb4f336 100644 --- a/src/components/Header.astro +++ b/src/components/Header.astro @@ -11,6 +11,8 @@ import starlightConfig from 'virtual:starlight/user-config'; import options from 'virtual:starlight-theme-nova/user-config'; import MobileMenuToggle from 'starlight-theme-nova/components/MobileMenuToggle.astro'; +import UserNav from './UserNav.astro'; + const route = Astro.locals.starlightRoute; const currentPath = normalizePath(Astro.url.pathname); const siteTitleHref = withBase(route.siteTitleHref); @@ -200,6 +202,7 @@ function getI18nText(value, activeRoute) {