integration-astro-static

Official

Add PostHog analytics to Astro static sites.

AuthorPostHog
Version1.0.0
Installs0

System Documentation

What problem does it solve?

Enable analytics and error tracking for Astro static sites by integrating PostHog's JavaScript Web SDK with a reusable, is:inline-based snippet and layout pattern.

Core Features & Use Cases

  • Inline PostHog snippet to prevent Astro from processing client-side code
  • Reusable PostHogLayout and PostHog component to wrap pages and initialize analytics consistently
  • Guidance and examples for identifying users, tracking events, and handling errors in Astro static projects

Quick Start

Copy the integration directory into your Astro project, set your PostHog tokens in environment variables, and wrap your pages with the PostHogLayout to enable analytics and error tracking.

Dependency Matrix

Required Modules

None required

Components

references

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: integration-astro-static
Download link: https://github.com/PostHog/skills/archive/main.zip#integration-astro-static

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.