Merge pull request #824 from makeplane/feat/session_recorder

feat: session recorder
This commit is contained in:
Vamsi Kurama 2023-04-14 16:09:31 +05:30 committed by GitHub
commit 3817511024
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 21 additions and 2 deletions

View File

@ -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
NEXT_PUBLIC_ENABLE_SENTRY=0
NEXT_PUBLIC_ENABLE_SESSION_RECORDER=0
NEXT_PUBLIC_TRACK_EVENTS=0

View File

@ -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 (
<Html>
<Head>
@ -9,6 +13,18 @@ class MyDocument extends Document {
<link rel="apple-touch-icon" href="/icon.png" />
<meta name="theme-color" content="#fff" />
<script defer data-domain="app.plane.so" src="https://plausible.io/js/script.js" />
{isSessionRecorderEnabled && (
<script
defer
dangerouslySetInnerHTML={{
__html: `(function(c,l,a,r,i,t,y){
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;
y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y);
})(window, document, "clarity", "script", "g6lhwgkmrp");`,
}}
/>
)}
</Head>
<body>
<Main />

View File

@ -13,7 +13,8 @@
"NEXT_PUBLIC_UNSPLASH_ACCESS",
"NEXT_PUBLIC_TRACK_EVENTS",
"TRACKER_ACCESS_KEY",
"NEXT_PUBLIC_CRISP_ID"
"NEXT_PUBLIC_CRISP_ID",
"NEXT_PUBLIC_ENABLE_SESSION_RECORDER"
],
"pipeline": {
"build": {