PrizePicks
BALANCE
$250.00
🏀 NBA 12
🏈 NFL
⚾ MLB
🏒 NHL
⚽ Soccer
🎾 Tennis

Cloudflare Worker Integration — GeoComply × PrizePicks

Location not verified Click "Verify Location" to run a geolocation check
Integration Architecture
🌐
User's BrowserPrizePicks 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: PP_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 PP_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 = "PP_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. You never handle license rotation.
# GeoComply does this for you: PP_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.PP_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.PP_SECRETS.get("gc_license"); return Response.json({ license }); }
Live KV State
PP_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.