Device Intelligence for Next.js
Full-stack Device Identification integration for Next.js (App Router + Pages Router). Add visitor identification, bot detection, and smart signals to your Next.js application in minutes.
Quick Install
Add the SDK to your project with your preferred package manager.
npm install @tracio/clientyarn add @tracio/clientpnpm add @tracio/clientBasic Usage
Get up and running with the minimal setup.
// app/layout.tsximport { TracioProvider } from '@tracio/client/react'export default function Layout({ children }) { return ( <TracioProvider apiKey="your-key"> {children} </TracioProvider> )}Advanced Patterns
Production-ready patterns with error handling, loading states, and advanced configuration.
Server-Side getServerSideProps Pattern — Click to expand
// pages/dashboard.tsximport { TracioServer } from '@tracio/client/node'export async function getServerSideProps(context) { const tracio = new TracioServer({ apiKey: process.env.TRACIO_SECRET }) const requestId = context.query.requestId as string const event = await tracio.getEvent(requestId) return { props: { visitorId: event.products.identification.data.visitorId, confidence: event.products.identification.data.confidence.score, botDetected: event.products.botd.data.bot.result !== 'notDetected', incognito: event.products.incognito.data.result, }, }}export default function Dashboard({ visitorId, confidence, botDetected }) { return ( <div> <h1>Welcome back, {visitorId.slice(0, 8)}...</h1> <p>Confidence: {(confidence * 100).toFixed(1)}%</p> {botDetected && <Alert>Bot activity detected</Alert>} </div> )}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 Next.js
Add device fingerprinting to your Next.js application in under 5 minutes.