
Company News
Socket Named Top Sales Organization by RepVue
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.
@seckav/security-sdk
Advanced tools
SecKav Security SDK - Developer-focused security platform with AI-powered threat detection, LLM-powered misconfiguration scanning (Gemini/GPT-4/Claude), end-to-end encryption, behavioral analysis, adaptive rate limiting, GDPR/DPDP/CERT-IN compliance repor
A comprehensive security SDK for Node.js applications providing AI-powered threat detection, LLM-powered misconfiguration scanning with Gemini/GPT-4/Claude, end-to-end encryption, behavioral analysis, enhanced file scanning, adaptive rate limiting, and advanced security monitoring.
npm install @seckav/security-sdk
import { SecKavSDK } from '@seckav/security-sdk';
const sdk = new SecKavSDK({
apiUrl: 'https://api.seckav.com',
organizationId: 'your-org-id',
apiKey: 'your-api-key', // or jwtToken: 'your-jwt-token'
features: {
rateLimit: true,
authentication: true,
organizationManagement: true,
security: true,
analytics: true,
enhancedSecurity: true, // 🆕 Enable AI-powered security features
complianceReporting: true, // 🚀 Enable GDPR/DPDP compliance
gitIntegration: true, // 🚀 Enable GitHub/GitLab scanning
encryption: true, // 🚀 Enable end-to-end encryption
misconfigurationScanning: true, // 🚀 Enable LLM-powered scanning
},
});
import express from 'express';
import { createSecKavMiddleware } from '@seckav/security-sdk';
const app = express();
// Apply SecKav security middleware
app.use(createSecKavMiddleware({
apiUrl: 'https://api.seckav.com',
organizationId: 'your-org-id',
apiKey: 'your-api-key',
}));
app.get('/api/protected', (req, res) => {
res.json({ message: 'This endpoint is protected by SecKav' });
});
// middleware.js
import { createSecKavNextMiddleware } from '@seckav/security-sdk';
const secKavMiddleware = createSecKavNextMiddleware({
apiUrl: 'https://api.seckav.com',
organizationId: 'your-org-id',
apiKey: 'your-api-key',
});
export async function middleware(request) {
return await secKavMiddleware(request);
}
export const config = {
matcher: '/api/:path*',
};
const authModule = sdk.getAuthenticationModule();
// Register a new user
const registerResult = await authModule.register(
'user@example.com',
'password123',
'John Doe'
);
// Login user
const loginResult = await authModule.login('user@example.com', 'password123');
const { token } = loginResult;
// Get user profile
const profileResult = await authModule.getProfile(token);
// Generate API key
const apiKeyResult = await authModule.generateApiKey(token, 'My API Key');
const orgModule = sdk.getOrganizationModule();
// Create organization
const orgResult = await orgModule.createOrganization(
token,
'My Company',
'Company description',
'company.com'
);
// Get organizations
const orgsResult = await orgModule.getOrganizations(token);
// Add member
const memberResult = await orgModule.addMember(token, orgId, {
email: 'member@example.com',
role: 'developer'
});
const securityModule = sdk.getSecurityModule();
// Get security settings
const settingsResult = await securityModule.getSecuritySettings(token);
// Update IP whitelist
const ipResult = await securityModule.updateIpWhitelist(token, [
'192.168.1.0/24',
'10.0.0.0/8'
]);
// Update user agent filtering
const uaResult = await securityModule.updateUserAgentFiltering(token, {
enabled: true,
blockedPatterns: ['bot', 'crawler'],
blockUnknownAgents: true
});
// Get security events
const eventsResult = await securityModule.getSecurityEvents(token, {
page: 1,
limit: 50,
severity: 'high'
});
const analyticsModule = sdk.getAnalyticsModule();
// Get real-time metrics
const metricsResult = await analyticsModule.getRealTimeMetrics(token);
// Get comprehensive analytics
const analyticsResult = await analyticsModule.getAnalytics(token, '24h');
// Get geo-distribution
const geoResult = await analyticsModule.getGeoDistribution(token, '7d');
// Track custom event
const trackResult = await analyticsModule.trackEvent(token, {
ipAddress: '192.168.1.100',
endpoint: '/api/custom',
method: 'POST',
userAgent: 'Custom Client/1.0'
});
const rateLimitModule = sdk.getRateLimitModule();
// Check rate limit manually
const rateLimitResult = await rateLimitModule.checkRequest(req);
if (!rateLimitResult.allowed) {
// Handle rate limit exceeded
console.log('Rate limit exceeded:', rateLimitResult.retryAfter);
}
const enhancedSecurity = sdk.getEnhancedSecurityModule();
// Analyze request for threats
const threatResult = await sdk.analyzeThreat(token, {
url: '/api/users',
method: 'POST',
headers: { 'User-Agent': 'Mozilla/5.0...' },
body: { username: 'john_doe', email: 'john@example.com' }
});
// Analyze for behavioral anomalies
const anomalyResult = await sdk.analyzeAnomaly(token, {
organizationId: 'your-org-id',
ipAddress: '192.168.1.100',
userAgent: 'Mozilla/5.0...',
endpoint: '/api/users',
method: 'GET',
payloadSize: 1024,
timestamp: new Date(),
country: 'US'
});
// Scan files for malware and threats
const fileResult = await sdk.scanFile(token, {
filename: 'document.pdf',
content: fileBuffer,
mimeType: 'application/pdf'
});
// Get comprehensive security metrics
const securityMetrics = await sdk.getSecurityMetrics(token, '24h');
// Check DDoS attack status
const ddosStatus = await sdk.checkDDoSStatus(token, 'your-org-id');
// Get security system health
const healthStatus = await sdk.getSecurityHealth(token);
// Configure security policy
await enhancedSecurity.configureSecurityPolicy(token, {
enableThreatDetection: true,
enableAnomalyDetection: true,
enableAdaptiveRateLimit: true,
enableFileScanning: true,
blockCritical: true,
blockHigh: true,
blockMedium: false,
maxFileSize: 10 * 1024 * 1024, // 10MB
allowedFileTypes: ['jpg', 'jpeg', 'png', 'pdf', 'docx']
});
// Get threat intelligence for IP
const threatIntel = await enhancedSecurity.getThreatIntelligence(token, '192.168.1.100');
// Analyze behavioral fingerprint
const behavioralResult = await enhancedSecurity.getBehavioralFingerprint(token, [
{
timestamp: new Date(),
endpoint: '/api/users',
method: 'GET',
userAgent: 'Mozilla/5.0...',
payloadSize: 1024,
responseTime: 150
}
]);
const config = {
apiUrl: 'https://api.seckav.com', // Required: SecKav API URL
organizationId: 'your-org-id', // Required: Your organization ID
apiKey: 'your-api-key', // Optional: API key for authentication
jwtToken: 'your-jwt-token', // Optional: JWT token for authentication
timeout: 5000, // Optional: Request timeout in ms
features: { // Optional: Enable/disable features
rateLimit: true,
authentication: true,
organizationManagement: true,
security: true,
analytics: true,
},
onError: (error) => console.error(error), // Optional: Error handler
debug: false, // Optional: Enable debug logging
};
The SDK maintains backward compatibility with v1.x for rate limiting:
import { createRateLimitMiddleware } from '@seckav/security-sdk';
const rateLimitMiddleware = createRateLimitMiddleware({
apiUrl: 'https://api.seckav.com',
organizationId: 'your-org-id',
apiKey: 'your-api-key',
});
app.use(rateLimitMiddleware);
new SecKavSDK(config: SecKavConfig)getExpressMiddleware(): FunctiongetNextMiddleware(): FunctiongetRateLimitModule(): RateLimitModule | nullgetAuthenticationModule(): AuthenticationModule | nullgetOrganizationModule(): OrganizationModule | nullgetSecurityModule(): SecurityModule | nullgetAnalyticsModule(): AnalyticsModule | nullgetInfo(): SDKInfoupdateConfig(config: Partial<SecKavConfig>): voidlogin(email: string, password: string): Promise<AuthResult>register(email: string, password: string, name: string): Promise<AuthResult>getProfile(token: string): Promise<AuthResult>createOrganization(token: string, name: string, description?: string, domain?: string): Promise<OrganizationResult>getOrganizations(token: string): Promise<OrganizationResult>getSecuritySettings(token: string): Promise<SecurityResult>updateIpWhitelist(token: string, ipAddresses: string[]): Promise<SecurityResult>getRealTimeMetrics(token: string): Promise<AnalyticsResult>getAnalytics(token: string, timeframe?: string): Promise<AnalyticsResult>MIT License - see LICENSE file for details.
const scanner = sdk.misconfigurationScanning;
// Configure LLM provider (Gemini, GPT-4, or Claude)
await scanner.configureLLM({
provider: 'gemini',
apiKey: 'your-gemini-api-key',
model: 'gemini-1.5-flash'
});
// Scan OpenAPI specification
const apiScanResult = await scanner.scanOpenAPISpec(
JSON.stringify(openApiSpec),
'api-spec.json'
);
// Scan configuration files
const configScanResult = await scanner.uploadAndScanFiles([
{
filename: '.env',
content: 'API_KEY=secret123\nDATABASE_URL=...',
type: 'environment'
}
]);
// Get AI-powered security recommendations
const recommendations = await scanner.getSecurityRecommendations({
organizationType: 'startup',
complianceRequirements: ['owasp', 'gdpr']
});
// Perform quick security assessment
const assessment = await scanner.quickAssessment({
apiSpecs: ['api-spec.json'],
includeRecommendations: true
});
const encryption = sdk.getEncryptionModule();
// Get encryption status
const status = await encryption.getEncryptionStatus(token);
// Enable encryption with configuration
await encryption.enableEncryption(token, {
algorithm: 'AES-256-GCM',
keyRotationInterval: 24, // hours
tlsMinVersion: '1.3'
});
// Rotate encryption keys manually
await encryption.rotateEncryptionKey(token, 'security-update');
// Test encryption functionality
const testResult = await encryption.testEncryption(token, {
message: 'test data'
});
const compliance = sdk.getComplianceModule();
// Generate compliance report
const gdprReport = await compliance.generateComplianceReport(
token,
'gdpr',
{
startDate: new Date('2024-01-01'),
endDate: new Date('2024-12-31')
}
);
// Get compliance dashboard
const dashboard = await compliance.getComplianceDashboard(token);
// Scan API specification for compliance
const complianceScan = await compliance.scanApiSpecification(token, {
name: 'user-api.json',
content: JSON.stringify(apiSpec),
type: 'openapi'
});
const gitIntegration = sdk.getGitIntegrationModule();
// Test GitHub connection
const connectionTest = await gitIntegration.testGitConnection(token, {
type: 'github',
token: 'github_pat_...',
});
// Get repositories
const repositories = await gitIntegration.getRepositories(token, {
type: 'github',
token: 'github_pat_...',
}, {
page: 1,
perPage: 50
});
// Scan repository for security issues
const repoScanResult = await gitIntegration.scanRepository(token, {
type: 'github',
token: 'github_pat_...',
}, 'repo-id', {
branch: 'main',
includeApiSpecs: true,
includeConfigFiles: true
});
FAQs
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
The npm package @seckav/security-sdk receives a total of 2 weekly downloads. As such, @seckav/security-sdk popularity was classified as not popular.
We found that @seckav/security-sdk demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.