Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,7 @@ GITHUB_TOKEN=
# route. Defaults to the canonical SNAP/ETH pair on Ethereum mainnet.
# Only change this if the pair migrates or you need to point at a test endpoint.
DEXSCREENER_PAIR_URL=https://api.dexscreener.com/latest/dex/pairs/ethereum/0x72a70a747a8390caf1aad3fb1de3564b55871f137539e498d30f02b1167742ea

# ─── PostHog analytics ───────────────────────────────────────────────────────
NEXT_PUBLIC_POSTHOG_PROJECT_TOKEN=your_posthog_project_token_here
NEXT_PUBLIC_POSTHOG_HOST=https://us.i.posthog.com
21 changes: 21 additions & 0 deletions instrumentation-client.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import posthog from "posthog-js";

const projectToken = process.env.NEXT_PUBLIC_POSTHOG_PROJECT_TOKEN;
const host = process.env.NEXT_PUBLIC_POSTHOG_HOST;

if (!projectToken || !host) {
if (process.env.NODE_ENV !== "production") {
throw new Error(
!projectToken
? "NEXT_PUBLIC_POSTHOG_PROJECT_TOKEN variable required by PostHog is missing or un-configured, this causes events to be silently missed. This error stops appearing once NEXT_PUBLIC_POSTHOG_PROJECT_TOKEN is configured"
: "NEXT_PUBLIC_POSTHOG_HOST variable required by PostHog is missing or un-configured, this causes events to be silently missed. This error stops appearing once NEXT_PUBLIC_POSTHOG_HOST is configured",
);
}
} else {
posthog.init(projectToken, {
api_host: host,
defaults: "2026-01-30",
capture_exceptions: true,
debug: process.env.NODE_ENV === "development",
});
}
106 changes: 106 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"lucide-react": "^1.14.0",
"next": "^16.2.5",
"postcss": "^8.5.15",
"posthog-js": "^1.410.6",
"react": "^19.2.4",
"react-dom": "^19.2.4",
"rehype-raw": "^7.0.0",
Expand Down
7 changes: 7 additions & 0 deletions src/components/copy-command.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"use client";

import { Check, Copy } from "lucide-react";
import posthog from "posthog-js";
import { useEffect, useRef, useState } from "react";

type CopyStatus = "idle" | "copied" | "failed";
Expand Down Expand Up @@ -32,6 +33,12 @@ export function CopyCommand({ value }: { value: string }) {

try {
await navigator.clipboard.writeText(value);
if (
process.env.NEXT_PUBLIC_POSTHOG_PROJECT_TOKEN &&
process.env.NEXT_PUBLIC_POSTHOG_HOST
) {
posthog.capture("command_copied");
}
setStatus("copied");
} catch {
setStatus("failed");
Expand Down
7 changes: 7 additions & 0 deletions src/components/node-info-checker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import { useState } from "react";
import { AlertTriangle, CheckCircle2, Eraser, Search } from "lucide-react";
import posthog from "posthog-js";

type Tone = "good" | "warn" | "bad" | "idle";

Expand Down Expand Up @@ -167,6 +168,12 @@ export function NodeInfoChecker() {
});
return;
}
if (
process.env.NEXT_PUBLIC_POSTHOG_PROJECT_TOKEN &&
process.env.NEXT_PUBLIC_POSTHOG_HOST
) {
posthog.capture("node_info_analyzed");
}
setResult(classifyInfo(trimmed));
}}
type="button"
Expand Down
Loading