Astro
Install
Section titled “Install”npm install @junctionjs/astro @junctionjs/client @junctionjs/coreAdd the Junction integration to your Astro config:
import { defineConfig } from "astro/config";import junction from "@junctionjs/astro";
export default defineConfig({ integrations: [ junction({ debug: true, }), ],});Features
Section titled “Features”- Automatic script injection at
before-hydration - SSR middleware for session, geo, and IP enrichment
- View Transitions support — page views tracked on every navigation
- Server-side
/api/collectendpoint - CSP-compatible (no
unsafe-inlineneeded)
Exports
Section titled “Exports”| Export | Description |
|---|---|
@junctionjs/astro | Astro integration (script injection, middleware) |
@junctionjs/astro/middleware | SSR middleware for server-side enrichment |
@junctionjs/astro/collect-endpoint | Server-side collect API route |
Full documentation coming soon.