@verifymail/sdk
Version:
Official JavaScript/TypeScript SDK for VerifyMail email verification API
36 lines (35 loc) • 1.02 kB
TypeScript
export interface ClientConfig {
apiKey: string;
baseUrl?: string;
timeout?: number;
maxRetries?: number;
headers?: Record<string, string>;
/**
* Enable to expose internal request details for debugging
* @default false
*/
debug?: boolean;
}
export declare class EmailVerificationClient {
private readonly apiKey;
private readonly baseUrl;
private readonly timeout;
private readonly maxRetries;
private readonly defaultHeaders;
private readonly debug;
constructor(config: ClientConfig);
request<T>(options: {
method: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH';
endpoint: string;
data?: unknown;
params?: Record<string, string | number | boolean>;
headers?: Record<string, string>;
signal?: AbortSignal;
}): Promise<T>;
private parseResponse;
private handleErrorResponse;
private generateRequestId;
private shouldNotRetry;
private calculateBackoff;
private combineSignals;
}