Skip to content

Commit 43de72b

Browse files
authored
feat(docs): add registering posthog source (#821)
Signed-off-by: Tomasz Knura <[email protected]>
1 parent 66bdd4a commit 43de72b

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

docs/docusaurus.config.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ const config = {
2121
defaultLocale: "en",
2222
locales: ["en"],
2323
},
24+
// Register posthog only in production
25+
clientModules: process.env.NODE_ENV === "production"
26+
? [require.resolve("./src/client-modules/register-posthog.js")]
27+
: [],
2428

2529
plugins: [
2630
[
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
export function onRouteUpdate() {
2+
const source = "docs";
3+
return window.posthog.register_once({ chainloop_source: source });
4+
}

0 commit comments

Comments
 (0)