fix: enhance bot ID initialization check in instrumentation client (#24961)

- Add additional check for the presence of window.crypto.randomUUID function
- Ensures compatibility with environments that support both getRandomValues and randomUUID

Co-authored-by: Udit Takkar <[email protected]>
This commit is contained in:
Hariom BalharaandUdit Takkar authored and GitHub committed 2025-11-06 12:00:31 +00:00
1 parent 7d17b443cf
commit 2e8b89c4ee
1 file changed
+2 -1
+2 -1
View File
@@ -53,7 +53,8 @@ export function onRouterTransitionStart(url: string, navigationType: "push" | "r
if (
process.env.NEXT_PUBLIC_VERCEL_USE_BOTID_IN_BOOKER === "1" &&
typeof window !== "undefined" &&
typeof window.crypto?.getRandomValues === "function"
typeof window.crypto?.getRandomValues === "function" &&
typeof window.crypto?.randomUUID === "function"
) {
initBotId({
protect: [