Skip to content

Builds and Analytics updates

The Astro template uses Node 24 and Astro 7.4.14. This documentation site uses Starlight 0.43.2. Follow the engine requirements in your supplied package.

Run npm ci, then npm run build. Each normal build refreshes Analytics for Astro from the stable npm latest tag, saves the exact resolved version and lockfile, then runs type checks, the static build and a production dependency audit. An incompatible peer version stops the build. Keep the lockfile produced by the build with its deployment artifact.

Use its saved lockfile, npm ci, and npm run build:locked. The same checks and audit run without a dependency refresh. A receipt in .local/astro-analytics-build.json records the resolved version and lockfile hash. Registry access is needed for a normal refresh; locked mode is an explicit reproduction choice.

The example ships with providers: false; no vendor IDs or hidden tracking are included. Configure your own property IDs in analytics.config.ts, then enable production injection with SITE_ANALYTICS=1. Keep private previews disabled. Use the SDK’s deferred or external consent mode and connect your consent interface to setConsent() from @codeworkslabs/astro-analytics/client when required.

Do not enable the template’s older local-module analytics hook and the SDK for the same provider. Script presence confirms configuration, not provider ingestion.

This policy is maintained by Analytics for Astro through its astro-analytics build command. Each site opts in through its package scripts. The integration does not modify dependencies after Astro has started.