Device Intelligence for AWS CloudFront
Proxy integration via CloudFront Lambda@Edge origin-request function. Add visitor identification, bot detection, and smart signals to your AWS CloudFront application in minutes.
Quick Install
Add the SDK to your project with your preferred package manager.
npm install aws-cdkyarn add aws-cdkpnpm add aws-cdkBasic Usage
Get up and running with the minimal setup.
// Lambda@Edge functionexports.handler = async (event) => { const request = event.Records[0].cf.request if (request.uri.startsWith('/fp/')) { request.origin = { custom: { domainName: 'your-fp-server.com', protocol: 'https', } } } return request}Advanced Patterns
Production-ready patterns with error handling, loading states, and advanced configuration.
Lambda@Edge with Origin Rewrite & IP Forwarding — Click to expand
// Lambda@Edge — origin-request functionexports.handler = async (event) => { const request = event.Records[0].cf.request if (!request.uri.startsWith('/fp/')) { return request } // Rewrite the origin to your tracio.ai server request.uri = request.uri.replace(/^\/fp/, '') request.origin = { custom: { domainName: process.env.FP_ORIGIN || 'fp.your-domain.com', 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}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 AWS CloudFront
Add device fingerprinting to your AWS CloudFront application in under 5 minutes.