Proxy integration via CloudFront Lambda@Edge origin-request function. Add visitor identification, bot detection, and smart signals to your AWS CloudFront application in minutes.
Add the SDK to your project with your preferred package manager.
npm install aws-cdkyarn add aws-cdkpnpm add aws-cdkGet up and running with the minimal setup.
// Lambda@Edge functionexports.handler = async (event) => { const request = event.Records[0].cf.request if (request.uri.startsWith('/tracio/')) { request.origin = { custom: { domainName: 'edge.tracio.ai', protocol: 'https', } } } return request}Production-ready patterns with error handling, loading states, and advanced configuration.
// Lambda@Edge — origin-request functionexports.handler = async (event) => { const request = event.Records[0].cf.request if (!request.uri.startsWith('/tracio/')) { return request } // Rewrite the origin to your tracio.ai server request.uri = request.uri.replace(/^\/tracio/, '') request.origin = { custom: { domainName: process.env.TRACIO_ORIGIN || 'edge.tracio.ai', port: 443, protocol: 'https', sslProtocols: ['TLSv1.2'], path: '', readTimeout: 10, keepaliveTimeout: 5, }, } // Forward client IP for accurate geolocation request.headers['x-forwarded-for'] = [{ key: 'X-Forwarded-For', value: request.clientIp, }] // Set cache behavior: cache agent script, skip identification if (request.uri.includes('/agent')) { request.headers['cache-control'] = [{ key: 'Cache-Control', value: 'public, max-age=3600', }] } return request}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 AWS CloudFront application in under 5 minutes.