v1.8.5
Consent checks read the banner's own choice, so analytics and embeds follow what the visitor accepted, and 1.x stays on Payload 3.93.x so the bundled patches apply.
On this page
HighlightsLink to this section
1.8.5 is a patch release. It fixes two bugs in 1.8. Most sites need no code change; a site that imports vanilla-cookieconsent itself must switch to the Systhema consent API (see Upgrade).
Consent checks read the banner's own choiceLink to this section
A site could ask a second copy of vanilla-cookieconsent whether the visitor had accepted a category. That copy was never initialized, so it always answered "no". Analytics, Google Consent Mode updates and embeds that were gated this way stayed off, even after the visitor accepted.
1.8.5 adds a consent API that reads the instance the Systhema banner started:
acceptedCategory(category)andacceptedService(service, category)return the stored choice. Both returnfalseon the server and before the banner starts.onConsentChange(callback)reports the initial state and every change. It returns an unsubscribe function.useConsent(category)re-renders a React client component when the category changes.
Import it from @systhemaui/react, from @systhemaui/next/consent in a Next.js app, or use the same methods on the SysthemaJS global with plain HTML. @systhemaui/next/consent needs @systhemaui/react 1.8.5 or later; the main @systhemaui/next entry is unchanged.
The state lives in the module that renders the banner, never on window, so no other script can fake a consent. A copy bundled apart from the banner always returns false, so a mismatch fails closed. A returning visitor's saved choice is readable as soon as the banner starts, before the banner's own callbacks run.
A new doctor check, cookie-consent-versions, warns when the lockfile resolves more than one version of vanilla-cookieconsent (pnpm, npm and Yarn). See Gating third-party scripts.
1.x stays on Payload 3.93.xLink to this section
The bundled pnpm patches for @payloadcms/richtext-lexical and @payloadcms/ui target Payload 3.93.0. With a ^3.93.0 range, a fresh install resolved 3.94.x, where the patched file is renamed and the patch failed to apply. The range is now ~3.93.0 in @systhemaui/payload, the Payload template, the patch keys and the CLI. systhema upgrade and systhema doctor use the same pin, so a project gets Payload patch releases only. 1.x is the LTS line and makes no Payload minor bump.
Both fixes were verified against real consumer projects.
UpgradeLink to this section
Run the upgrade, then the doctor:
systhema upgrade
systhema doctorThere are no codemods, token migrations or breaking changes.
- If your site imports
vanilla-cookieconsentitself, switch those calls to the Systhema consent API above and removevanilla-cookieconsentfrom your ownpackage.json. Reinstall, so only one copy, 3.3.0, remains.systhema doctor --only cookie-consent-versionsconfirms it. - The
~3.93.0range on@payloadcms/*is intended. Do not widen it on 1.x: the bundled patches only apply to 3.93.x.
ChangesLink to this section
- fix(astro,core,elements,next,react): read active banner consent (#1494)
- fix(payload,cli): keep 1.x on payload 3.93.x so the bundled patches apply (#1333)
Packages affectedLink to this section
@systhemaui/core, @systhemaui/react, @systhemaui/next, @systhemaui/payload, @systhemaui/cli. The other packages are versioned with them and have no changes.