Kind: Function
Source: atloria-monorepo/apps/api/src/events/agent-detect.ts
Classify a User-Agent for agent-read recording.
- Known AI bot → its normalized vendor name.
- Empty / scripted UA → 'Other bot' (record it — it's not a human).
- Real browser → null (don't record; that's page-view analytics).
- Anything else unknown → 'Other bot' (better to log than to lose the signal).
Signature
tsfunction detectAiAgent(userAgent: string | null): string | null
Parameters
| Name | Type |
|---|---|
userAgent | `string |
Returns: string | null
Was this page helpful?