First-party React hook for device identification. Add visitor identification, bot detection, and smart signals to your React application in minutes.
Add the SDK to your project with your preferred package manager.
npm install @tracio/reactyarn add @tracio/reactpnpm add @tracio/reactGet up and running with the minimal setup.
import { useVisitorId } from '@tracio/react'function App() { const { data: visitorId } = useVisitorId() return <div>Visitor: {visitorId}</div>}Production-ready patterns with error handling, loading states, and advanced configuration.
import { TracioProvider, useTracioResult } from '@tracio/react'function App() { return ( <TracioProvider publicKey={process.env.NEXT_PUBLIC_TRACIO_KEY!} endpoint="/tracio/identify" timeoutMs={15000} > <ProtectedPage /> </TracioProvider> )}function ProtectedPage() { const { data, isLoading, error } = useTracioResult() if (isLoading) return <Spinner /> if (error) return <ErrorBanner message={error.message} /> return ( <div> <p>Visitor: {data?.visitorId}</p> <p>Bot: {data?.bot.detected ? 'detected' : 'clear'} ({data?.bot.confidence}/100)</p> </div> )}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 React application in under 5 minutes.