@bulut5/ck
v0.2.0
Published
Lightweight cookie-consent banner with Google Consent Mode v2 + Microsoft UET signaling for React.
Readme
ck
A lightweight, dependency-free cookie-consent banner for React that signals Google Consent Mode v2 and Microsoft UET. Default-deny, granular categories, SSR-safe, themeable with Tailwind.
Install
npm i @bulut5/ckUsage
import { ConsentProvider, CookieConsent } from "@bulut5/ck";
const config = {
brand: "example",
locale: "en-GB",
privacyPolicyUrl: "/privacy",
copy: { /* … see BrandConfig */ },
};
export default function App() {
return (
<ConsentProvider config={config}>
{/* your app */}
<CookieConsent />
</ConsentProvider>
);
}The host page should set the Google Consent Mode default to denied inline in <head> before
the bundle loads; the banner flips signals to granted on consent. Tailwind consumers should add
./node_modules/@bulut5/ck/dist/**/*.{js,mjs} to their content so the banner classes compile.
MIT licensed.
