Proxy integration via Cloudflare Workers for first-party routing. Add visitor identification, bot detection, and smart signals to your Cloudflare application in minutes.
Add the SDK to your project with your preferred package manager.
npm install wrangleryarn add wranglerpnpm add wranglerGet up and running with the minimal setup.
// Cloudflare Workerexport default { async fetch(request, env) { const url = new URL(request.url) if (url.pathname.startsWith('/tracio/')) { return fetch('https://edge.tracio.ai' + url.pathname) } return fetch(request) }}Production-ready patterns with error handling, loading states, and advanced configuration.
// Cloudflare Worker — production proxyexport default { async fetch(request: Request, env: Env): Promise<Response> { const url = new URL(request.url) if (!url.pathname.startsWith('/tracio/')) { return fetch(request) } // Strip the /fp prefix and proxy to your tracio.ai server const targetPath = url.pathname.replace(/^\/tracio/, '') const target = `https://${env.TRACIO_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 },}All available options for initializing and configuring the SDK.
publicKeystringYour public key from the dashboard — safe to ship in the browserendpointstringCustom endpoint URL for proxy-routed deployments — an explicit URL wins over regionregionstringData region: us or eutimeoutMsnumberTimeout for the whole getResult() call, in millisecondslinkedIdstringYour internal account ID for the signed-in user, so visits sharing a device can be linkedtagstringFree-form label attached to the identification request, e.g. checkout or logindebugbooleanLogs the script lifecycle and network activity to the browser consolescriptUrlstringFull override for the agent script URL — for self-hosting or Subresource IntegrityGo deeper with the full API reference, webhook configuration, and advanced guides.
Full API reference, integration guides, and best practices.
Real-time event delivery, payload schema, and signature verification.
Configure real-time event notifications for every device identification.
Add device fingerprinting to your Cloudflare application in under 5 minutes.