OptionaluserAgent: string
Optional user-agent string. Defaults to
navigator.userAgent when available. An explicit value replaces only the
user-agent source; the current browser's WebDriver signal is still checked.
"crawler", "automation", or "unknown", in that priority.
Safe during SSR and in Node.js. This is a heuristic classification utility, not human verification, crawler authentication, or a security boundary. Do not use it by itself for authentication, authorization, payments, rate limiting, fraud prevention, access control, or security-sensitive content. Genuine crawler verification generally requires server-side request information and provider-specific validation.
Classify a visitor using conservative browser-side heuristics.
Classification checks known crawler and automated-fetcher user-agent tokens first. It then checks explicit browser-automation user-agent tokens and
navigator.webdriver === true. All other visitors return"unknown"."unknown"means that no supported signal was detected. It does not verify that the visitor is human. User-agent values can be modified or spoofed, and automation signals can be hidden, modified, or unavailable. Both false positives and false negatives are possible.Usage:
Possible output:
Explicit user-agent:
Output: