UNPKG

@seckav/security-sdk

Version:

Lightweight API Security SDK for Enterprises - One-click protection with rate limiting, threat detection, security analytics, and real-time monitoring for Express.js and Next.js applications

26 lines 965 B
export interface RateLimitConfig { apiUrl: string; organizationId: string; apiKey: string; timeout?: number; onError?: (error: any) => void; } export interface RateLimitResult { allowed: boolean; rateLimitHit: boolean; error?: string; message?: string; retryAfter?: number; policy?: any; current?: any; headers?: Record<string, string>; action?: any; } export declare class RateLimitSDK { private config; constructor(config: RateLimitConfig); checkRateLimit(endpoint: string, method: string, clientId?: string, userAgent?: string, ipAddress?: string): Promise<RateLimitResult>; } export declare function createRateLimitMiddleware(config: RateLimitConfig): (req: any, res: any, next: any) => Promise<any>; export declare function createNextRateLimitMiddleware(config: RateLimitConfig): (req: any) => Promise<import("undici-types").Response | null>; //# sourceMappingURL=rateLimitMiddleware.d.ts.map