https://github.com/jop-software/astro-posthog
Astro Integration for PostHog
https://github.com/jop-software/astro-posthog
astro astro-integration integration posthog withastro
Last synced: 6 months ago
JSON representation
Astro Integration for PostHog
- Host: GitHub
- URL: https://github.com/jop-software/astro-posthog
- Owner: jop-software
- License: gpl-3.0
- Created: 2025-07-06T11:40:48.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2025-07-07T17:58:54.000Z (6 months ago)
- Last Synced: 2025-07-07T19:20:03.866Z (6 months ago)
- Topics: astro, astro-integration, integration, posthog, withastro
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/astro-posthog
- Size: 69.3 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Posthog + Astro Integration
> GDRP friendly tracking in your astro app / site 🚀
## Installation
### Installation using the Astro CLI
Using the Astro CLI is the [recommended way](https://docs.astro.build/en/guides/integrations-guide/#automatic-integration-setup) to setup integrations in Astro.
```console
# npm
npx astro add astro-posthog
# pnpm
pnpm dlx astro add astro-posthog
```
### Manual Installation
When the automatic setup from Astro is not an option for you, feel free to install the package manually.
```console
# npm
npm install astro-posthog
# pnpm
pnpm add astro-posthog
```
## Usage
```js
import { defineConfig } from 'astro/config';
import posthog from "astro-posthog";
// https://astro.build/config
export default defineConfig({
integrations: [
posthog({
posthogKey: 'phc_your-posthog-key',
api_host: 'https://eu.i.posthog.com',
defaults: '2025-05-24',
person_profiles: 'identified_only',
}),
]
});
```
© 2025-current, jop-software Inh. Johannes Przymusinski