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 <53316345+Udit-takkar@users.noreply.github.com>
This commit is contained in:
Hariom Balhara
2025-11-06 12:00:31 +00:00
committed by GitHub
co-authored by Udit Takkar
parent 7d17b443cf
commit 2e8b89c4ee
+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: [