Skip to content

fix(site): PostHog 빌드 변수에 PUBLIC_ 접두사를 단다 - #106

Merged
minjun0219 merged 1 commit into
mainfrom
feat/site-posthog-public-env
Oct 4, 2026
Merged

minjun0219 merged 1 commit into
mainfrom
feat/site-posthog-public-env

Conversation

@minjun0219

@minjun0219 minjun0219 commented Oct 3, 2026 •

Copy link
Copy Markdown
Owner

PostHog 빌드 변수 이름에 Astro 의 공개 접두사를 단다 — POSTHOG_KEY · POSTHOG_HOST → PUBLIC_POSTHOG_KEY · PUBLIC_POSTHOG_HOST. 브라우저로 나가는 값은 프레임워크의 공개 접두사를 유지한다는 표준에 맞춘 것이고, 동작은 #105 와 같다.

변경 사항

스키마와 import 의 이름만 바뀐다

하나라도 없으면 초기화하지 않고 SDK 코드도 담지 않는 동작은 그대로다. 옛 이름(POSTHOG_*)은 더 이상 읽지 않는다.
site/astro.config.mjs:79
site/src/analytics.ts:4

배포 변수는 두 이름이 잠시 같이 있다

프로덕션 빌드 변수에 PUBLIC_POSTHOG_* 를 같은 값으로 먼저 더해 두었다. 이 PR 이 배포되고 $host = mdwire.minjun.dev 이벤트가 확인되면 POSTHOG_* 를 지운다.

검증

변수 없음 · 새 이름 · 옛 이름만, 세 경우로 pnpm run check 와 pnpm run build 를 돌렸다 — 없음과 옛 이름만은 SDK 참조 없이 통과(레이아웃 청크가 main 과 동일), 새 이름은 둘 다 번들에 들어가 통과. 실제 이벤트 확인은 머지 뒤 프로덕션 빌드에서 한다.

🤖 Generated with Claude Code

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Oct 3, 2026 •

Copy link
Copy Markdown

🚀 Deploying Preview to Cloudflare 🚀

Preview Deployments by commit

Status Deployment URL Commit Updated (UTC) See this deployment's details
  • Build: Failed ❌

View logs ↗
e0b2d57 2026-10-04T01:17:41.631Z View logs ↗
  • Build: Failed ❌

View logs ↗
0799ea7 2026-10-03T23:47:25.280Z View logs ↗

@minjun0219
minjun0219 marked this pull request as ready for review October 3, 2026 23:46
브라우저로 나가는 값은 프레임워크의 공개 접두사를 유지한다는 표준(Astro 는 `PUBLIC_`)에
맞춘다 — `POSTHOG_KEY` · `POSTHOG_HOST` 를 `PUBLIC_POSTHOG_KEY` · `PUBLIC_POSTHOG_HOST` 로.
동작은 같다 — 하나라도 없으면 초기화하지 않고 SDK 코드도 담지 않는다.

프로덕션 빌드 변수에는 새 이름을 먼저 더해 두었다. 이 변경이 배포되고 이벤트가 확인되면
옛 이름을 지운다.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@minjun0219
minjun0219 force-pushed the feat/site-posthog-public-env branch from 0799ea7 to e0b2d57 Compare October 4, 2026 01:17
@minjun0219
minjun0219 merged commit 8e52dff into main Oct 4, 2026
6 of 8 checks passed
@minjun0219
minjun0219 deleted the feat/site-posthog-public-env branch October 4, 2026 01:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant