Skip to content

Commit 9b67e2e

Browse files
chore(Sky): Remove hardcoded PostHog API key from source
Replace the hardcoded PostHog API key with empty strings in both PostHogBridge.ts and astro.config.ts. The key should be sourced exclusively from the LAND_POSTHOG_KEY environment variable to prevent production credentials from being committed to the repository. This sanitizes the codebase of the exposed `phc_...` key that was present in two locations.
1 parent 4d9fb69 commit 9b67e2e

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

Source/Workbench/Electron/PostHogBridge.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
// working before `.env.Land.PostHog` is sourced.
2626
const PostHogAPIKey =
2727
((import.meta.env as any).LAND_POSTHOG_KEY as string | undefined) ??
28-
"phc_mCwHy7LgvbnEqh6a2DyMiLUJcaZvmmj7JNmmpQzvr7mA";
28+
"";
2929
const PostHogHost =
3030
((import.meta.env as any).LAND_POSTHOG_HOST as string | undefined) ??
3131
"https://eu.i.posthog.com";

astro.config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -708,7 +708,7 @@ export default defineConfig({
708708
try {
709709
const Body = JSON.stringify({
710710
api_key:
711-
"phc_mCwHy7LgvbnEqh6a2DyMiLUJcaZvmmj7JNmmpQzvr7mA",
711+
"",
712712
event: "sky:build:complete",
713713
properties: {
714714
distinct_id: `land-dev-${process.env["USER"] || "unknown"}`,
@@ -788,7 +788,7 @@ export default defineConfig({
788788
// reports to the Land project.
789789
"import.meta.env.LAND_POSTHOG_KEY": JSON.stringify(
790790
process.env["LAND_POSTHOG_KEY"] ??
791-
"phc_mCwHy7LgvbnEqh6a2DyMiLUJcaZvmmj7JNmmpQzvr7mA",
791+
"",
792792
),
793793
"import.meta.env.LAND_POSTHOG_HOST": JSON.stringify(
794794
process.env["LAND_POSTHOG_HOST"] ??

0 commit comments

Comments
 (0)