Install
One tag, nothing else. Brand color, font, radius and color scheme are inherited from the host page.
<script src="https://krispy-widget.pages.dev/v1/krispy-widget.js" defer
data-site-name="Site Name"
data-ga-id="G-XXXXXXXX"
data-privacy-url="/privacy.html"></script>
Sites track /v1/, which always serves the current build. Version folders such as /v1.2.2/ are immutable archives kept as a rollback lever, not pin targets.
Attributes
data-site-namerequiredUsed in the consent banner copy.data-ga-idThe site's real GA measurement ID. Analytics stay off until the visitor accepts. Carry this across when migrating a site, or you silently kill analytics the visitor already agreed to.data-privacy-urlLinked from the consent banner.data-statement-urlAccessibility statement, linked in the panel footer.data-consentSet tooffto mount the accessibility panel with no consent banner. For internal tools that set no cookies.data-langenores. Read once at load. For a same URL language toggle callwindow.KrispyWidget.setLang(lang)instead.data-positionrightorleft. Default right.data-accent,data-brand,data-font,data-radius,data-schemeOverrides for the inherited look. Only needed when inheritance picks the wrong token.
Gated embeds
Scripts and iframes carrying data-consent-src are held inert until consent is granted. That markup is handled natively, so never hand roll a second gate over it. Add data-consent-decorative to an ambient embed, such as a background hero video, to suppress the visible placeholder while keeping it gated.
What this widget is not
An overlay does not make a site compliant, and no copy on a client site should say it does. The FTC fined accessiBe $1M for claiming otherwise, and sites that carry overlays still get sued.
What actually defends a client is WCAG conformance in the page itself plus an accessibility statement with a real contact route. Treat this widget as a convenience layer on top of that work, never as a substitute for it.