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: 'api.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 || 'api.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.
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)Go deeper with the full API reference, webhook configuration, and advanced guides.
Full API reference, integration guides, and best practices.
Server API endpoints, request/response schemas, and error codes.
Configure real-time event notifications for every device identification.
Add device fingerprinting to your AWS CloudFront application in under 5 minutes.