Skip to content

Astro

Terminal window
npm install @junctionjs/astro @junctionjs/client @junctionjs/core

Add the Junction integration to your Astro config:

astro.config.mjs
import { defineConfig } from "astro/config";
import junction from "@junctionjs/astro";
export default defineConfig({
integrations: [
junction({
debug: true,
}),
],
});
  • 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/collect endpoint
  • CSP-compatible (no unsafe-inline needed)
ExportDescription
@junctionjs/astroAstro integration (script injection, middleware)
@junctionjs/astro/middlewareSSR middleware for server-side enrichment
@junctionjs/astro/collect-endpointServer-side collect API route

Full documentation coming soon.