Skip to content
PricingDocs
All Integrations
Node.js

Device Intelligence for Node.js

Server-side event verification for Node.js and Express. Add visitor identification, bot detection, and smart signals to your Node.js application in minutes.

Quick Install

Add the SDK to your project with your preferred package manager.

npmnpm install @tracio/client
yarnyarn add @tracio/client
pnpmpnpm add @tracio/client

Basic Usage

Get up and running with the minimal setup.

$typescript
import { TracioServer } from '@tracio/client/node'
const tracio = new TracioServer({
apiKey: process.env.TRACIO_SECRET,
})
const event = await tracio.getEvent(requestId)
console.log(event.products.identification.data.visitorId)

Advanced Patterns

Production-ready patterns with error handling, loading states, and advanced configuration.

Express Middleware with Full Verification — Click to expand
import express from 'express'
import { TracioServer } from '@tracio/client/node'
const app = express()
const tracio = new TracioServer({ apiKey: process.env.TRACIO_SECRET })
app.use(express.json())
app.post('/api/protected', async (req, res) => {
const { requestId } = req.body
try {
const event = await tracio.getEvent(requestId)
const { visitorId, confidence } = event.products.identification.data
const isBot = event.products.botd.data.bot.result !== 'notDetected'
if (isBot) {
return res.status(403).json({ error: 'Bot detected' })
}
if (confidence.score < 0.9) {
return res.status(401).json({ error: 'Low confidence' })
}
res.json({ visitorId, confidence: confidence.score })
} catch (err) {
res.status(502).json({ error: 'Verification failed' })
}
})
app.listen(3000)

Configuration Options

All available options for initializing and configuring the SDK.

apiKeystringYour API key from the dashboard
endpointstringCustom endpoint URL for proxy-routed deployments
regionstringData region (us, eu, ap)
timeoutnumberRequest timeout in milliseconds
extendedResultbooleanAdds bot detection, incognito mode flags, and smart signals
linkedIdstringCustom identifier to associate visits (e.g. user ID or session ID)