Skip to content

Commit f779bc5

Browse files
committed
Address feedback
1 parent 3a0f8a9 commit f779bc5

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

packages/telemetry/src/helpers.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,10 @@ export function getSessionId(): string | undefined {
5555
* 2. In Cloud Logging as its own log entry
5656
*/
5757
export function startNewSession(loggerProvider: LoggerProvider): void {
58-
if (typeof sessionStorage !== 'undefined') {
58+
if (
59+
typeof sessionStorage !== 'undefined' &&
60+
typeof crypto?.randomUUID === 'function'
61+
) {
5962
try {
6063
const sessionId = crypto.randomUUID();
6164
sessionStorage.setItem(TELEMETRY_SESSION_ID_KEY, sessionId);

0 commit comments

Comments
 (0)