Quickstart
Get started with c15t in vanilla JavaScript — framework-agnostic consent management with no UI dependencies.
Installation
Initialize the Runtime
getOrCreateConsentRuntime() creates a consent client and a Zustand vanilla store in a single call. The store holds all consent state and exposes methods for checking, setting, and subscribing to consent changes.
Subscribe to State Changes
The store is a Zustand vanilla store — use subscribe() to react to consent changes and getState() to read the current state:
Check and Set Consent
Minimal Consent Prompt
Here's a bare-bones example using the store to drive a consent prompt — no framework required:
Verify It Works
Open the browser console and inspect the store state:
Info
No UI included — the c15t core package is fully headless. See Building UI for creating your own components, or use @c15t/react / @c15t/nextjs for pre-built UI.
Optional: Install Agent Skills
Install c15t agent skills to let AI agents help with styling, i18n, scripts & other configuration.
See AI Tools for details.
Next Steps
- Client Modes — Choose between c15t, offline, or custom backend
- Store API — Full reference for store state and actions
- Script Loader — Gate third-party scripts behind consent
- Building UI — Create your own consent components
- AI Agent Skills — Let AI assistants help configure c15t