Framework agnostic
A tiny vanilla JS core that works everywhere. React bindings included — bring your own components, or use ours.
@uabcodus/consent is a headless, framework-agnostic consent management library. It handles all
the tricky parts — cookie storage, script blocking, consent state, callbacks, revision management —
and stays out of your way when it comes to UI.
import { createConsent } from "@uabcodus/consent/core";
const consent = createConsent({ // configure what you need! categories: { necessary: { readOnly: true }, analytics: {}, marketing: {} } as const});
consent.accept("all"); // fully type-safeconsent.acceptedCategory("analytics"); // trueFramework agnostic
A tiny vanilla JS core that works everywhere. React bindings included — bring your own components, or use ours.
Type-safe
Full TypeScript support with generics that infer your category and service names. Autocomplete all the way.
Composable
Every piece is optional. Use presets, mix in your own config, subscribe to state changes, hook into events.
Production ready
Handles bots, SSR hydration, script blocking, auto-clear, revision re-consent, localStorage fallback, and Google Consent Mode v2.
<script> tags by data-category until consent is givensyncGtagConsentConsentProvider + useConsent hook with automatic re-rendersReady to give it a spin? Jump to the quick start →