integration-astro-ssr

Integrate Amplitude analytics into Astro SSR projects with client and server tracking.

28|Updated Dec 5, 2025
One-click install
npx skills add https://github.com/amplitude/wizard --skill integration-astro-ssr-amplitude
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: integration-astro-ssr
Source: https://github.com/amplitude/wizard/tree/main/skills/integration/integration-astro-ssr
Command: npx skills add https://github.com/amplitude/wizard --skill integration-astro-ssr-amplitude

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Astro SSR apps often struggle to instrument analytics across both client and server boundaries; this skill provides a cohesive Amplitude integration for Astro SSR with API routes, enabling server-side events and client tracking on a unified setup.

Core Features & Use Cases

  • Client-side and server-side Amplitude integration for Astro SSR using the Unified SDK on the client and the Node SDK on the server
  • Initialize on the client with @amplitude/unified and on the server with @amplitude/analytics-node
  • Track events from API routes and server contexts while maintaining user identity and respecting PII guidelines

Quick Start

Install dependencies, configure environment variables, and run your Astro project to verify end-to-end analytics.

Frequently Asked Questions about integration-astro-ssr

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I integrate Amplitude analytics into an Astro SSR app?

Astro SSR Amplitude integration requires configuring Amplitude API key environment variables, installing the @amplitude/unified client SDK and @amplitude/analytics-node server SDK, then running your Astro project to verify end-to-end analytics initialization across both boundaries.

Does Amplitude analytics work with Astro server-side rendering and API routes?

Astro SSR apps expose API endpoints that allow server-side Amplitude tracking via @amplitude/analytics-node. Client-side initialization runs alongside this using @amplitude/unified, ensuring events from both environments contribute to a unified analytics setup with consistent user identification.

Why do I need both client-side and server-side SDKs for Amplitude in Astro?

Astro SSR apps render on the server and expose API endpoints, requiring client initialization with @amplitude/unified and server tracking with @amplitude/analytics-node. This dual-SDK approach enables end-to-end Astro SSR analytics with consistent user identification across both boundaries.

What environment variables do I need to configure for Amplitude server-side tracking in Astro?

Astro SSR Amplitude integration requires configuring Amplitude API key environment variables, installing the @amplitude/unified client SDK and @amplitude/analytics-node server SDK, then running your Astro project to verify end-to-end analytics initialization across both boundaries.

What's the best way to track server-side events in Astro while maintaining user identity?

Astro SSR apps expose API endpoints that allow server-side Amplitude tracking via @amplitude/analytics-node. Client-side initialization runs alongside this using @amplitude/unified, ensuring events from both environments contribute to a unified analytics setup with consistent user identification.

Can I track events from API routes in Astro SSR without breaking user identification?

Astro SSR apps expose API endpoints that allow server-side Amplitude tracking via @amplitude/analytics-node. Client-side initialization runs alongside this using @amplitude/unified, ensuring events from both environments contribute to a unified analytics setup with consistent user identification.