Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
19e7a10
fix(docs): theme-adaptive favicon that survives Chromium's icon selec…
EricAndrechek Jun 5, 2026
201aaa2
docs: address pre-push review — changelog entry + stale comments
EricAndrechek Jun 5, 2026
aca38b9
Merge remote-tracking branch 'origin/main' into docs-spotfixes
EricAndrechek Jun 5, 2026
78cf9ee
Merge remote-tracking branch 'origin/main' into docs-spotfixes
EricAndrechek Jun 5, 2026
b1599f9
feat(docs): prod-faithful dev-docs loop + mermaid render cache
EricAndrechek Jun 5, 2026
0b54c50
docs: refresh stale CI/review-automation references
EricAndrechek Jun 5, 2026
06d0a4b
docs: scope browser claims to the build; fix renamed AGENTS.md heading
EricAndrechek Jun 5, 2026
bf19ac6
docs: qualify screenshot helper path as docs/scripts/screenshot.mjs
EricAndrechek Jun 5, 2026
2083e8a
docs: correct admin-approval ruleset comment; complete AGENTS clean list
EricAndrechek Jun 5, 2026
d4278d5
Merge remote-tracking branch 'origin/main' into docs-spotfixes
EricAndrechek Jun 5, 2026
c598c18
minor capitalization tweaks, editor warnings
EricAndrechek Jun 5, 2026
e73b184
removing old posthog mechanism
EricAndrechek Jun 5, 2026
74cc02c
Merge remote-tracking branch 'origin/main' into docs-spotfixes
EricAndrechek Jun 5, 2026
4c68766
Merge remote-tracking branch 'origin/main' into docs-spotfixes
EricAndrechek Jun 5, 2026
a1a891b
posthog wizard on docs, exactly as is before tweaking
EricAndrechek Jun 5, 2026
77872cf
fix(docs): posthog relay host, prod token fallback, MDX build fix
EricAndrechek Jun 5, 2026
12a734c
docs: address pre-push review findings for the posthog change set
EricAndrechek Jun 5, 2026
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
Empty file.
57 changes: 57 additions & 0 deletions .claude/skills/integration-astro-view-transitions/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
---
name: integration-astro-view-transitions
description: PostHog integration for Astro with ClientRouter view transitions
metadata:
author: PostHog
version: 1.21.1
---

# PostHog integration for Astro (View Transitions)

This skill helps you add PostHog analytics to Astro (View Transitions) applications.

## Workflow

Follow these steps in order to complete the integration:

1. `basic-integration-1.0-begin.md` - PostHog Setup - Begin ← **Start here**
2. `basic-integration-1.1-edit.md` - PostHog Setup - Edit
3. `basic-integration-1.2-revise.md` - PostHog Setup - Revise
4. `basic-integration-1.3-conclude.md` - PostHog Setup - Conclusion

## Reference files

- `references/EXAMPLE.md` - Astro (View Transitions) example project code
- `references/astro.md` - Astro - docs
- `references/identify-users.md` - Identify users - docs
- `references/basic-integration-1.0-begin.md` - PostHog setup - begin
- `references/basic-integration-1.1-edit.md` - PostHog setup - edit
- `references/basic-integration-1.2-revise.md` - PostHog setup - revise
- `references/basic-integration-1.3-conclude.md` - PostHog setup - conclusion

The example project shows the target implementation pattern. Consult the documentation for API details.

## Key principles

- **Environment variables**: Always use environment variables for PostHog keys. Never hardcode them.
- **Minimal changes**: Add PostHog code alongside existing integrations. Don't replace or restructure existing code.
- **Match the example**: Your implementation should follow the example project's patterns as closely as possible.

## Framework guidelines

- Always use the is:inline directive on PostHog script tags to prevent Astro from processing them and causing TypeScript errors
- Use PUBLIC_prefix for client-side environment variables in Astro (e.g., PUBLIC_POSTHOG_PROJECT_TOKEN)
- Create a posthog.astro component in src/components/ for reusable initialization across pages
- Import the PostHog component in a Layout and wrap all pages with that layout
- Wrap PostHog initialization with a window.__posthog_initialized guard to prevent stack overflow during soft navigation
- Set capture_pageview option to 'history_change' for automatic pageview tracking during soft navigation
- Use the astro page-load event instead of just DOMContentLoaded to re-run scripts after soft navigation
- When a reverse proxy is configured, both /static/*AND /array/* must route to the assets origin (us-assets.i.posthog.com or eu-assets.i.posthog.com).

## Identifying users

Identify users during login and signup events. Refer to the example code and documentation for the correct identify pattern for this framework. If both frontend and backend code exist, pass the client-side session and distinct ID using `X-POSTHOG-DISTINCT-ID` and `X-POSTHOG-SESSION-ID` headers to maintain correlation.

## Error tracking

Add PostHog error tracking to relevant files, particularly around critical user flows and API boundaries.
Loading
Loading