tessl install tessl/npm-isbot@5.1.0Recognise bots/crawlers/spiders using the user agent string.
Agent Success
Agent success rate when using this tile
82%
Improvement
Agent success rate improvement when using this tile compared to baseline
0.94x
Baseline
Agent success rate without this tile
87%
Build a module that classifies user agent strings as bots or humans using the dependency's compiled bot-detection patterns.
isBot set to false and no match string. @testisBot set to true and a match string that reflects the matched bot identifier from detection. @testallowlist includes a token such as "Lighthouse" and the input contains that token, the entry is reported as human even though the base bot pattern would match; the override should be applied by adjusting the dependency's curated pattern list before detection. @test@generates
export interface Classification {
userAgent: string;
isBot: boolean;
match?: string;
}
export interface ClassificationOptions {
allowlist?: string[];
}
export function classifyUserAgents(
userAgents: string[],
options?: ClassificationOptions
): Classification[];
export const compiledBotPattern: RegExp;Detects automated traffic via a compiled regular expression derived from a curated pattern list and exposes that pattern data for customization.