Skip to content
PricingDocs
All Integrations
Cloudflare

Device Intelligence for Cloudflare

Proxy integration via Cloudflare Workers for first-party routing. Add visitor identification, bot detection, and smart signals to your Cloudflare application in minutes.

Quick Install

Add the SDK to your project with your preferred package manager.

npmnpm install wrangler
yarnyarn add wrangler
pnpmpnpm add wrangler

Basic Usage

Get up and running with the minimal setup.

$typescript
// Cloudflare Worker
export default {
async fetch(request, env) {
const url = new URL(request.url)
if (url.pathname.startsWith('/fp/')) {
return fetch('https://your-fp-server.com' + url.pathname)
}
return fetch(request)
}
}

Advanced Patterns

Production-ready patterns with error handling, loading states, and advanced configuration.

Full Worker with Caching & Header Forwarding — Click to expand
// Cloudflare Worker — production proxy
export default {
async fetch(request: Request, env: Env): Promise<Response> {
const url = new URL(request.url)
if (!url.pathname.startsWith('/fp/')) {
return fetch(request)
}
// Strip the /fp prefix and proxy to your tracio.ai server
const targetPath = url.pathname.replace(/^\/fp/, '')
const target = `https://${env.FP_ORIGIN}${targetPath}${url.search}`
const headers = new Headers(request.headers)
headers.set('X-Forwarded-For', request.headers.get('CF-Connecting-IP') || '')
headers.set('X-Real-IP', request.headers.get('CF-Connecting-IP') || '')
const response = await fetch(target, {
method: request.method,
headers,
body: request.method !== 'GET' ? request.body : undefined,
})
// Cache static agent script for 1 hour
const res = new Response(response.body, response)
if (targetPath.includes('/agent')) {
res.headers.set('Cache-Control', 'public, max-age=3600')
}
return res
},
}

Configuration Options

All available options for initializing and configuring the SDK.

apiKeystringYour API key from the dashboard
endpointstringCustom endpoint URL for proxy-routed deployments
regionstringData region (us, eu, ap)
timeoutnumberRequest timeout in milliseconds
extendedResultbooleanAdds bot detection, incognito mode flags, and smart signals
linkedIdstringCustom identifier to associate visits (e.g. user ID or session ID)

Next Steps

Go deeper with the full API reference, webhook configuration, and advanced guides.

Get started with Cloudflare

Add device fingerprinting to your Cloudflare application in under 5 minutes.