UNPKG

anil-brd-typescript-sdk

Version:

TypeScript SDK for Bright Data APIs - Web Unlocker, SERP, and Scraper APIs

55 lines (54 loc) 1.59 kB
export interface BrightDataConfig { apiKey: string; zone: string; baseUrl?: string; timeout?: number; } export interface SimpleConfig { apiKey?: string; country?: string; format?: 'raw' | 'json'; method?: 'GET' | 'POST'; } export declare const DEFAULT_CONFIG: SimpleConfig; export interface IWebUnlockerService { unlock(url: string, options: UnlockOptions): Promise<UnlockResponse>; } export interface UnlockOptions { async?: boolean; country?: string; format?: 'raw' | 'json'; method?: 'GET' | 'POST' | 'PUT' | 'DELETE'; data_format?: 'markdown' | 'screenshot'; } export interface UnlockResponse { content: string; status: number; headers?: Record<string, string>; requestId?: string; url?: string; } export declare class BrightDataError extends Error { statusCode?: number | undefined; response?: any | undefined; requestId?: string | undefined; suggestion?: string | undefined; learnMoreUrl?: string | undefined; constructor(message: string, statusCode?: number | undefined, response?: any | undefined, requestId?: string | undefined, suggestion?: string | undefined, learnMoreUrl?: string | undefined); } export interface HttpClientConfig { apiKey: string; baseUrl?: string; timeout?: number; userAgent?: string; } export interface ApiResponse<T = any> { data: T; status: number; headers: Record<string, string>; requestId?: string; } export * from './client'; export * from './config'; export * from './error'; export { BrightData } from './simple-client';