Skip to content

Upload PostHog source maps during builds - #54

Merged
xrendan merged 1 commit into
mainfrom
codex/upload-posthog-source-maps
Aug 10, 2026
Merged

Upload PostHog source maps during builds#54
xrendan merged 1 commit into
mainfrom
codex/upload-posthog-source-maps

Conversation

@xrendan

@xrendan xrendan commented Aug 10, 2026

Copy link
Copy Markdown
Member

Summary

  • add the PostHog Next.js build integration for source-map generation, chunk ID injection, upload, and post-upload deletion
  • keep builds working when upload credentials are not configured
  • pass the personal API key through a BuildKit secret so it is not persisted in Docker image history or cache

Dokploy setup

The current deployment continues to build if these values are absent; source-map upload is simply skipped. To enable uploads for the Dockerfile build, set:

  • Build Time Arguments: POSTHOG_PROJECT_ID=141116
  • Build-time Secrets: POSTHOG_API_KEY=

Do not put POSTHOG_API_KEY in Dokploy runtime environment variables or build arguments. Dokploy recommends build-time secrets for sensitive build credentials.

Verification

  • pnpm exec eslint next.config.ts
  • POSTHOG_API_KEY= POSTHOG_PROJECT_ID= pnpm exec tsc --noEmit
  • docker build --check .
  • production compilation and type checking pass with upload credentials absent; the complete local build reaches prerendering and then fails because the production API configured for static pages is unavailable locally
  • repo-wide lint remains red because ESLint traverses generated files in an existing .claude worktree

@xrendan
xrendan merged commit 6ae174e into main Aug 10, 2026
1 check passed
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