@botwall/sdk
Version:
BotWall SDK for site protection and bot crawling
34 lines • 1.44 kB
TypeScript
import { BotConfig, SiteConfig, VerifyResponse, FetchOptions } from './types';
export declare class BotWallClient {
private apiUrl;
constructor(apiUrl?: string);
/**
* Verify bot and site credentials, check credits, and deduct 1 credit
* @param botConfig - Bot configuration with ID and API key
* @param siteConfig - Site configuration with ID
* @param options - Additional options like path and user agent
* @returns Promise<VerifyResponse>
*/
verify(botConfig: BotConfig, siteConfig: SiteConfig, options?: FetchOptions): Promise<VerifyResponse>;
/**
* Manually deduct credits from a bot (alternative to automatic deduction)
* @param botConfig - Bot configuration with ID and API key
* @param creditsToDeduct - Number of credits to deduct (default: 1)
* @returns Promise<{ creditsDeducted: number; remainingCredits: number }>
*/
deductCredits(botConfig: BotConfig, creditsToDeduct?: number): Promise<{
creditsDeducted: number;
remainingCredits: number;
}>;
/**
* Get bot information including current credit balance
* @param botConfig - Bot configuration with ID and API key
* @returns Promise<{ botId: string; botName: string; credits: number }>
*/
getBotInfo(botConfig: BotConfig): Promise<{
botId: string;
botName: string;
credits: number;
}>;
}
//# sourceMappingURL=client.d.ts.map