Superline Agent Detection is designed to be easy to integrate into any web application. This quick start guide will help you get up and running in minutes.
import AgentDetector from '@superline-ai/agent-detection';// Initialize the detectorAgentDetector.init({ debug: false, autoStart: true, threshold: 0.6 // Optional: Set custom detection threshold (default: 0.5)});// Later, when you want to check if the session is from an agentconst result = await AgentDetector.finalizeDetection();console.log('Is agent:', result.isAgent, 'Confidence:', result.confidence);
You can easily integrate Superline Agent Detection with your analytics platform to differentiate between humans and AI agents in your metrics.
Copy
// After getting the detection resultconst result = await AgentDetector.finalizeDetection();// Example with Google Analytics 4gtag('set', 'user_properties', { is_agent: result.isAgent, agent_confidence: result.confidence});// Example with Mixpanelmixpanel.people.set({ 'Is Agent': result.isAgent, 'Agent Confidence': result.confidence});