From c7d930f89bf92d9d1d73165718064295b4f75dfc Mon Sep 17 00:00:00 2001 From: Aaryan Khandelwal <65252264+aaryan610@users.noreply.github.com> Date: Fri, 14 Apr 2023 15:17:35 +0530 Subject: [PATCH] chore: add env flag to enable session recorder conditionally (#822) --- apps/app/.env.example | 4 +++- apps/app/pages/_document.tsx | 18 ++++++++++++------ turbo.json | 3 ++- 3 files changed, 17 insertions(+), 8 deletions(-) diff --git a/apps/app/.env.example b/apps/app/.env.example index 371a64c80..1e2576dfc 100644 --- a/apps/app/.env.example +++ b/apps/app/.env.example @@ -5,4 +5,6 @@ NEXT_PUBLIC_GITHUB_APP_NAME="" NEXT_PUBLIC_GITHUB_ID="" NEXT_PUBLIC_SENTRY_DSN="" NEXT_PUBLIC_ENABLE_OAUTH=0 -NEXT_PUBLIC_ENABLE_SENTRY=0 \ No newline at end of file +NEXT_PUBLIC_ENABLE_SENTRY=0 +NEXT_PUBLIC_ENABLE_SESSION_RECORDER=0 +NEXT_PUBLIC_TRACK_EVENTS=0 \ No newline at end of file diff --git a/apps/app/pages/_document.tsx b/apps/app/pages/_document.tsx index e1e516304..a257f649f 100644 --- a/apps/app/pages/_document.tsx +++ b/apps/app/pages/_document.tsx @@ -2,6 +2,10 @@ import Document, { Html, Head, Main, NextScript } from "next/document"; class MyDocument extends Document { render() { + const isSessionRecorderEnabled = parseInt( + process.env.NEXT_PUBLIC_ENABLE_SESSION_RECORDER || "0" + ); + return ( @@ -9,16 +13,18 @@ class MyDocument extends Document {