DRAFTKINGS
Sportsbook
Casino
DFS
Balance
$1,247.50
Live Now
🏈 NFL
🏀 NBA
🏒 NHL
⚾ MLB
🥊 MMA
⚽ Soccer
🎾 Tennis
⛳ Golf
🐎 Horses
🎯
No Sweat First Bet up to $1,500 New customer offer · Place your first bet — get it back in bonus bets if it loses

Live Now LIVE

View all 24 →

Today's Top Games

View all →

Cloudflare Worker Integration — GeoComply × DraftKings

Location not verified Click "Verify Location" to run a geolocation check
Integration Architecture
🌐
User's BrowserDraftKings sportsbook — requests SDK + license
GET /api/sdk · GET /api/license
Cloudflare Worker/api/sdk → proxies gc-html5.js  ·  /api/license → reads KV
Reads "gc_sdk_url" + "gc_license" from KV
🗄️
KV Namespace: DK_SECRETSGeoComply manages SDK version + license — operator touches neither
SDK + license delivered to browser → SDK initialised
📍
Browser Geolocation APISDK collects location · result returned to your app
Operator Setup — 3 Steps
1
Create a KV Namespace
Run once in your Cloudflare dashboard or via Wrangler CLI. This is where GeoComply will write the license.
# Wrangler CLI wrangler kv:namespace create DK_SECRETS
2
Bind the KV to your Worker
Add the binding to wrangler.toml. The namespace ID comes from step 1.
# wrangler.toml [[kv_namespaces]] binding = "DK_SECRETS" id = "<namespace-id>"
3
GeoComply pushes the license — you're done
GeoComply writes the license key to your KV namespace automatically and keeps it fresh. Operator never handles license rotation, SDK upgrades, or distribution.
# GeoComply does this for you: DK_SECRETS["gc_license"] = <signed-license-token> # TTL managed by GeoComply — always valid
Worker Code
api/sdk.js — proxies SDK from GeoComply CDN
export async function onRequestGet({ env }) { // SDK URL managed in KV by GeoComply const url = await env.DK_SECRETS.get("gc_sdk_url") ?? "https://cdn.geocomply.com/gc-html5.js"; const js = await fetch(url); return new Response(await js.text(), { headers: { "Content-Type": "application/javascript" } }); }
api/license.js — serves license from KV
export async function onRequestGet({ env }) { // License written by GeoComply, never by operator const license = await env.DK_SECRETS.get("gc_license"); return Response.json({ license }); }
Live KV State
DK_SECRETS → "gc_license"
Not fetched yet — click Verify Location
The license shown above was served from KV by the Cloudflare Worker at /api/license. No token management code lives in your app.