Documentation
Getting Started
Welcome to the Suraksha documentation. This guide will help you get started with our device fingerprinting and bot detection API.
Installation
First, install the Suraksha SDK using npm or yarn:
npm install @suraksha/client-sdk
Basic Usage
Import and initialize the Suraksha client with your API key:
import { SurakshaClient } from '@suraksha/client-sdk';
// Initialize the client
const client = new SurakshaClient({
apiKey: 'YOUR_API_KEY',
endpoint: 'https://api.suraksha-security.com',
});
// Start monitoring for bot activity
client.startMonitoring();
Handling Detection Events
You can listen for detection events and handle them according to your security policy:
// Listen for bot detection events
client.on('botDetected', (event) => {
console.log('Bot detected!', event);
// Implement your security policy
if (event.riskScore > 0.8) {
// High-risk bot, block access
showCaptcha();
} else {
// Low-risk, just log the activity
logSuspiciousActivity(event);
}
});
Advanced Configuration
Customize the behavior of the SDK with advanced configuration options:
const client = new SurakshaClient({
apiKey: 'YOUR_API_KEY',
endpoint: 'https://api.suraksha-security.com',
options: {
fingerprinting: {
enabledTechniques: ['canvas', 'webgl', 'audio', 'fonts'],
fingerprintV3: true,
},
monitoring: {
interval: 5000, // Check every 5 seconds
reportLevel: 'warning', // 'info', 'warning', or 'severe'
},
behavioralAnalysis: true,
}
});
Next Steps
Continue exploring our documentation to learn more about:
- Server-side verification API
- Integration with popular frameworks
- Custom fingerprinting techniques
- Webhook configuration
- Analytics dashboard