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.
npm install wrangleryarn add wranglerpnpm add wranglerBasic Usage
Get up and running with the minimal setup.
// Cloudflare Workerexport 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 proxyexport 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 dashboardendpointstringCustom endpoint URL for proxy-routed deploymentsregionstringData region (us, eu, ap)timeoutnumberRequest timeout in millisecondsextendedResultbooleanAdds bot detection, incognito mode flags, and smart signalslinkedIdstringCustom 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.
Documentation
Full API reference, integration guides, and best practices.
API Reference
Server API endpoints, request/response schemas, and error codes.
Webhooks
Configure real-time event notifications for every device identification.
Get started with Cloudflare
Add device fingerprinting to your Cloudflare application in under 5 minutes.