UNPKG

@fairfetch/fair-fetch

Version:

Protect your site from AI scrapers by adding invisible noise to your site which confuses AI bots while keeping your site looking and functioning normally for your human visitors.

20 lines 645 B
import { BotAgent } from '../types/BotAgent'; export declare class BotValidator { userAgent: BotAgent; ipAddress: string; constructor(headers: Headers, ipAddress: string); /** * Asynchronously validates the bot based on user agent and IP. */ isValid(): Promise<boolean>; /** * Fetch one of Google's JSON lists and extract all CIDR prefixes. */ fetchCidrs(url: string): Promise<any[]>; /** * Load (or reload) all Google IP ranges into memory. * Call once at startup, and schedule a daily refresh. */ loadIpRanges(): Promise<void>; } //# sourceMappingURL=BotValidator.d.ts.map