All systems nominal · edge p95 12ms v0.1.0GDPR · CCPA
How it works

Three pieces. None of them block your page.

Swift sits at the edge, between your users and your origin. The banner is in the HTML before the browser even starts parsing. Zero client-side injection cost.

01

Edge rendering

A Cloudflare Worker sits between your users and your origin. On each HTML request it reads the visitor's geo from CF headers, checks the swift_consent cookie, and — if consent is needed — injects the banner markup and CSS inline before </body>. No client JS is required to display the banner.

02

1.8KB hydration

A tiny vanilla-JS runtime loads with defer — after the page has already painted. It attaches click handlers to the pre-rendered banner, writes consent decisions to a cookie, fires Google Consent Mode v2 signals (consent/defaultconsent/update), and calls your CMP's audit API. No framework. No polyfills. No layout shift.

03

Your CMP, wrapped

Consent decisions are relayed back to your existing CMP's audit log via their API. Cookiebot (logconsent.ashx), OneTrust (CPM API), Iubenda, Didomi supported. Compliance stays with them. Legal exposure stays with them. Swift just renders faster.

15 minutes to production.

Option A — Cloudflare Worker (recommended)

# 1. Install
bun install
wrangler login

# 2. Build + deploy
bun run build
bun run deploy

# 3. Point your DNS
CNAME yourdomain.com → swift-consent.*.workers.dev

Option B — Script tag (5 minutes, no DNS change)

<!-- Add above your existing CMP script -->
<script
src="https://cdn.swiftconsent.dev/sdk.js"
defer
></script>

<!-- Optional: configure your CMP relay -->
<script>
window.__SWIFT_CONFIG__ = {
upstream: { cmp: 'cookiebot', cbid: 'YOUR-CBID' }
};
</script>

What happens on every page load.

0msBrowser requests yourdomain.com ~12msCloudflare Worker receives request at nearest PoP (180+ locations) ~12msWorker reads geo from CF headers, checks swift_consent cookie ~20msWorker fetches from your origin, streams response ~20msWorker injects banner HTML + CSS inline before </body> (if needed) LCP paintBanner is already in the DOM. Zero client JS required to display it. +defer1.8KB SDK loads, attaches click handlers, fires Consent Mode v2 default on clickUser accepts/rejects → SDK fires consent/update → releases gated tags → POSTs to CMP audit API
See it live → Read the API →