Getting Started

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.

Installation

npm install @superline-ai/agent-detection

Basic Usage

import AgentDetector from '@superline-ai/agent-detection';

// Initialize the detector
AgentDetector.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 agent
const result = await AgentDetector.finalizeDetection();
console.log('Is agent:', result.isAgent, 'Confidence:', result.confidence);

Integration with Analytics

You can easily integrate Superline Agent Detection with your analytics platform to differentiate between humans and AI agents in your metrics.

// After getting the detection result
const result = await AgentDetector.finalizeDetection();

// Example with Google Analytics 4
gtag('set', 'user_properties', {
  is_agent: result.isAgent,
  agent_confidence: result.confidence
});

// Example with Mixpanel
mixpanel.people.set({
  'Is Agent': result.isAgent,
  'Agent Confidence': result.confidence
});

Analytics Integrations

Learn more about integrating with analytics platforms like Google Analytics and Mixpanel

Next Steps