mirror of
https://github.com/makeplane/plane
synced 2024-06-14 14:31:34 +00:00
chore: add env flag to enable session recorder conditionally (#822)
This commit is contained in:
parent
81da8715d5
commit
c7d930f89b
@ -6,3 +6,5 @@ NEXT_PUBLIC_GITHUB_ID=""
|
|||||||
NEXT_PUBLIC_SENTRY_DSN=""
|
NEXT_PUBLIC_SENTRY_DSN=""
|
||||||
NEXT_PUBLIC_ENABLE_OAUTH=0
|
NEXT_PUBLIC_ENABLE_OAUTH=0
|
||||||
NEXT_PUBLIC_ENABLE_SENTRY=0
|
NEXT_PUBLIC_ENABLE_SENTRY=0
|
||||||
|
NEXT_PUBLIC_ENABLE_SESSION_RECORDER=0
|
||||||
|
NEXT_PUBLIC_TRACK_EVENTS=0
|
@ -2,6 +2,10 @@ import Document, { Html, Head, Main, NextScript } from "next/document";
|
|||||||
|
|
||||||
class MyDocument extends Document {
|
class MyDocument extends Document {
|
||||||
render() {
|
render() {
|
||||||
|
const isSessionRecorderEnabled = parseInt(
|
||||||
|
process.env.NEXT_PUBLIC_ENABLE_SESSION_RECORDER || "0"
|
||||||
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Html>
|
<Html>
|
||||||
<Head>
|
<Head>
|
||||||
@ -9,16 +13,18 @@ class MyDocument extends Document {
|
|||||||
<link rel="apple-touch-icon" href="/icon.png" />
|
<link rel="apple-touch-icon" href="/icon.png" />
|
||||||
<meta name="theme-color" content="#fff" />
|
<meta name="theme-color" content="#fff" />
|
||||||
<script defer data-domain="app.plane.so" src="https://plausible.io/js/script.js" />
|
<script defer data-domain="app.plane.so" src="https://plausible.io/js/script.js" />
|
||||||
<script
|
{isSessionRecorderEnabled && (
|
||||||
defer
|
<script
|
||||||
dangerouslySetInnerHTML={{
|
defer
|
||||||
__html: `(function(c,l,a,r,i,t,y){
|
dangerouslySetInnerHTML={{
|
||||||
|
__html: `(function(c,l,a,r,i,t,y){
|
||||||
c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)};
|
c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)};
|
||||||
t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i;
|
t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i;
|
||||||
y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y);
|
y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y);
|
||||||
})(window, document, "clarity", "script", "g6lhwgkmrp");`,
|
})(window, document, "clarity", "script", "g6lhwgkmrp");`,
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
)}
|
||||||
</Head>
|
</Head>
|
||||||
<body>
|
<body>
|
||||||
<Main />
|
<Main />
|
||||||
|
@ -13,7 +13,8 @@
|
|||||||
"NEXT_PUBLIC_UNSPLASH_ACCESS",
|
"NEXT_PUBLIC_UNSPLASH_ACCESS",
|
||||||
"NEXT_PUBLIC_TRACK_EVENTS",
|
"NEXT_PUBLIC_TRACK_EVENTS",
|
||||||
"TRACKER_ACCESS_KEY",
|
"TRACKER_ACCESS_KEY",
|
||||||
"NEXT_PUBLIC_CRISP_ID"
|
"NEXT_PUBLIC_CRISP_ID",
|
||||||
|
"NEXT_PUBLIC_ENABLE_SESSION_RECORDER"
|
||||||
],
|
],
|
||||||
"pipeline": {
|
"pipeline": {
|
||||||
"build": {
|
"build": {
|
||||||
|
Loading…
Reference in New Issue
Block a user