@c15t/astro
| Install | |
|---|---|
npm install @c15t/astro |
|
| Latest Version: | 3.1.0 |
| Vue: | 3 |
| License: | Apache-2.0 |
| Last Updated: | Oct 22, 2026 |
| Links: | GitHub · npm |
@c15t/astro: Astro cookie banner and cookie consent management
Cookie banner, preference dialog, and consent-gated scripts for Astro 5, 6, and 7. Middleware resolves each request's consent policy, such as GDPR opt-in in the EU. The banner is plain .astro markup with no framework JavaScript. The preference dialog loads as a Svelte, React, or Vue island only when a visitor opens it.
c15t is used by 2,100+ sites, including expo.dev, zed.dev, unkey.dev, mintlify.com, and sazabi.com.
Key Features
- Visitors download no UI framework for the banner. The dialog's framework loads only when a visitor opens it
- Write the dialog island in Svelte, React, or Vue, so it uses the framework your site already ships
- Static output works on any static host with
hosted(). Server output resolves each visitor's policy, so the banner is in the first HTML - Geo-aware middleware reads location and language headers from your host
- Analytics, ads, and pixels follow each visitor's choice through @c15t/integrations: Google Tag Manager, Google Consent Mode v2, GA4, Meta Pixel, PostHog, and more
- IAB TCF 2.4 banner and dialog components
Prerequisites
- Astro 5, 6, or 7
- One of
@astrojs/svelte,@astrojs/react, or@astrojs/vuefor the preference dialog - A server adapter for server output, or none for static output
- An Inth project (free sign-up), a self-hosted backend, or offline mode for local development
Installation
pnpm add c15t @astrojs/svelte svelte @astrojs/node
The c15t package re-exports this package at c15t/astro, and the docs use that path. For React or Vue dialogs, install @astrojs/react react react-dom or @astrojs/vue vue instead of Svelte. @astrojs/node is the server adapter in the example below. Use your host's adapter instead, or leave it out for static output.
Usage
- Set
PUBLIC_C15T_BACKEND_URLto your Inth backend URL in.env - Register your UI framework, then
c15t(), inastro.config.mjs
// astro.config.mjs
import node from '@astrojs/node'
import svelte from '@astrojs/svelte'
import { defineConfig } from 'astro/config'
import c15t from 'c15t/astro'
export default defineConfig({
adapter: node({ mode: 'standalone' }),
integrations: [svelte(), c15t()],
output: 'server',
})
- Add
ConsentScriptto<head>, andConsentBanner,ConsentDialog, andConsentDialogLinkto your layout, fromc15t/astro/components - For static output, the full layout, and island options, see the Astro quickstart
Hosting
c15t needs somewhere to keep policies and consent records. Pick one:
- Hosted on Inth: Inth runs the backend for you. You get policy storage, consent records, audit history, and a dashboard, with no database or server to run. Sign-up is free.
- Self-hosted: Run
@c15t/backendon your own server with PostgreSQL, MySQL, or SQLite. You own migrations, backups, and uptime. See the self-hosting guide. - Offline: Choices stay in the browser, with no consent records. Use it for local development, previews, and demos, not production.
The frontend code is the same for Inth and a self-hosted backend. Only the backend URL changes.
Documentation
See the documentation for guides, API reference, and examples.
Docs for AI Agents
This package ships its documentation as Markdown, matched to the installed version. After you install it, point your coding agent at node_modules/@c15t/astro/AGENTS.md. It indexes every guide in node_modules/@c15t/astro/docs/.
On the web, every page of the c15t docs has a Markdown version, and llms.txt lists them all. Install the c15t agent skills with npx skills add c15t/skills.
Support
- Join our Discord community
- Open an issue on our GitHub repository
- Visit inth.com and use the chat widget
- Contact our support team via email support@inth.com
Contributing
- Read the contribution guidelines before you open a pull request
- Follow the code of conduct
Security
Do not open a public issue for a security vulnerability. Report it privately through GitHub's vulnerability reporting. We examine every valid report.
- Do not share the vulnerability in public forums, issues, or pull requests
- Give the steps to reproduce it and the versions it affects
- Give us time to release a fix before you disclose it
License
Built by Inth
Related Packages
The open standard for cookie banners. Open-source cookie consent management plat...
Vue and Nuxt cookie consent banner, consent dialog and preference center. A GDPR...
Server-rendered cookie consent for Nuxt without a third-party script: an SSR con...
Framework-agnostic cookie banner UI primitives, CSS and theme tokens behind the...
Centralized cookie consent management (CMP) for 30+ sites — a typed wrapper arou...
Version History
| Version | Released | License |
|---|---|---|
| 3.1.0 | Apache-2.0 | |
| 3.0.0 | Apache-2.0 |
Pre-releases (15)
| Version | Released | License |
|---|---|---|
| 3.1.0-canary.0 | Apache-2.0 | |
| 3.0.1-canary-198c836e9e869389f889eb3195a9e7b3e3902275.0 | Apache-2.0 | |
| 3.0.0-alpha.12 | Apache-2.0 | |
| 3.0.0-alpha.11 | Apache-2.0 | |
| 3.0.0-alpha.10 | Apache-2.0 | |
| 3.0.0-alpha.9 | Apache-2.0 | |
| 3.0.0-alpha.8 | Apache-2.0 | |
| 3.0.0-alpha.7 | Apache-2.0 | |
| 3.0.0-alpha.6 | Apache-2.0 | |
| 3.0.0-alpha.5 | Apache-2.0 | |
| 3.0.0-alpha.4 | Apache-2.0 | |
| 3.0.0-alpha.3 | Apache-2.0 | |
| 3.0.0-alpha.2 | Apache-2.0 | |
| 3.0.0-alpha.1 | Apache-2.0 | |
| 3.0.0-alpha.0 | Apache-2.0 |