Draft
Kings
Sportsbook
Casino
Daily Fantasy
Promotions
Verify Location
Balance
$500.00
+ Deposit
🏀 NBA
🏈 NFL
⚾ MLB
🏒 NHL
⚽ Soccer
🏆 NCAA
🎾 Tennis
🥊 Boxing/MMA
🏌️ Golf
NBA — Today's Games
● LIVE
Spread
Money Line
Total
Developer
Cloudflare Worker Integration
— GeoComply × DraftKings
✕
Location not verified
Click "Verify Location" to run a geolocation check
Integration Architecture
🌐
User's Browser
DraftKings web app — 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_SECRETS
GeoComply manages SDK version + license — operator touches neither
SDK + license delivered to browser → SDK initialised
📍
Browser Geolocation API
SDK 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.
# Wrangler CLI
wrangler kv:namespace create
DK_SECRETS
2
Bind KV to your Worker
Add the binding to
wrangler.toml
.
# wrangler.toml
[[kv_namespaces]]
binding
=
"DK_SECRETS"
id
=
"<namespace-id>"
3
GeoComply pushes the license — you're done
GeoComply writes and rotates the license automatically. Zero operator maintenance.
# 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 above was served from KV by the CF Worker at
/api/license
. No token management code lives in your app.