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

77 lines 2.45 kB
import { SecKavConfig } from '../types/common'; export interface SecKavMiddleware { expressMiddleware: () => any; nextMiddleware: () => any; } /** * SecKav Security SDK - Lightweight Client SDK for API Protection * * Core Features: * - Rate Limiting with DDoS protection * - API Firewall (WAF-lite) with threat detection * - Encryption Gateway with TLS enforcement * - Misconfiguration Scanner for security assessment * - Basic Analytics (sends data to dashboard) * * What this SDK does NOT do (handled by dashboard): * - User authentication/registration * - Organization management * - Compliance reporting * - Git integration */ export declare class SecKavSDK { private config; private rateLimit?; private security?; private encryption?; private misconfigurationScanner?; constructor(config: SecKavConfig); private initializeModules; /** * Get Express.js middleware with all enabled security features * This is the main integration point for most users */ getExpressMiddleware(): any; /** * Get Next.js middleware */ getNextMiddleware(): (req: any) => Promise<Response | null>; /** * Manual rate limit check (for custom implementations) */ checkRateLimit(endpoint: string, method: string, clientId?: string): Promise<any>; /** * Get security settings (requires authentication token) */ getSecuritySettings(token: string): Promise<any>; /** * Scan for misconfigurations (requires backend API) * This would typically be called from dashboard, not client SDK */ scanMisconfigurations(token: string, files: Array<{ name: string; content: string; }>): Promise<any>; /** * Get SDK information and enabled features */ getInfo(): { version: string; organizationId: string; apiUrl: string; enabledFeatures: string[]; availableFeatures: string[]; }; private getEnabledFeatures; /** * Send analytics data to dashboard (private method) */ private sendAnalytics; /** * Update configuration at runtime */ updateConfig(newConfig: Partial<SecKavConfig>): void; } export declare function createSecKavMiddleware(config: SecKavConfig): any; export declare function createSecKavNextMiddleware(config: SecKavConfig): (req: any) => Promise<Response | null>; //# sourceMappingURL=SecKavSDK.d.ts.map