Velohost Velohost

Astro Integration

Astro Consent

A privacy-first, zero-dependency cookie consent banner for Astro — built for speed, compliance, and total visual control.

Last Updated: 01 April 2026

Usage Snapshot

850

Downloads in Last 30 Days

v2.0.0

Latest npm Version

Source: npm registry

Why This Plugin Exists

Most cookie consent solutions are bloated, opaque, or tied to third-party services.

Astro Consent is built differently: no trackers, no remote calls, no analytics SDKs, and no vendor lock-in.

It provides a deterministic, developer-controlled consent layer that respects user privacy and legal boundaries.

Design Principles

  • Privacy-first by design
  • Zero runtime dependencies
  • Build-time integration
  • Frontend-controlled script loading
  • Full CSS-based theming
  • Clean install and clean removal

What This Plugin Delivers

  • GDPR / UK GDPR friendly consent model
  • Essential, analytics, and marketing categories
  • Preferences modal with toggle switches
  • Zero runtime JavaScript dependencies
  • Fully themeable via CSS variables
  • CLI installer and remover
  • Clean uninstall with no residue
  • Framework-agnostic frontend API

Installation

npm install astro-consent

After installation, run `npx astro-consent` to inject the integration and generate the CSS file automatically.

FAQs

Does Astro Consent include any trackers or analytics?

No. Astro Consent performs no tracking, analytics, telemetry, or external network requests.

Is Astro Consent GDPR and UK GDPR friendly?

Yes. It prevents non-essential scripts from loading before explicit consent is given.

Can I fully customise the appearance?

Yes. All visuals are controlled via CSS variables in a single stylesheet.

Implementation FAQs

Why does Astro Consent exist?

To provide a fast, deterministic cookie consent solution without tracking, vendor lock-in, or runtime dependencies.

Does Astro Consent run at runtime?

The integration is applied at build time. Only minimal client-side logic runs to store and read consent.

What consent categories are supported?

Essential, analytics, and marketing. Scripts outside essential must be conditionally loaded.

How is the banner styled?

All styling is controlled via CSS variables in a generated stylesheet that you fully own.

Is there a frontend API?

Yes. A small global API allows reading, setting, and resetting consent state.

Can Astro Consent be completely removed?

Yes. Running `npx astro-consent remove` cleanly removes all integration code and generated files.

Project Links

Source code, package distribution, releases, and documentation.

Need Implementation Details?

Read the FAQs for usage patterns, integration caveats, and rollout guidance.