> ## Documentation Index
> Fetch the complete documentation index at: https://docs.superline.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Quick Start

> Get up and running with Superline Agent Detection in minutes

## 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

<Tabs>
  <Tab title="npm">
    ```bash theme={null}
    npm install @superline-ai/agent-detection
    ```
  </Tab>

  <Tab title="yarn">
    ```bash theme={null}
    yarn add @superline-ai/agent-detection
    ```
  </Tab>

  <Tab title="pnpm">
    ```bash theme={null}
    pnpm add @superline-ai/agent-detection
    ```
  </Tab>

  <Tab title="Script Tag">
    ```html theme={null}
    <!-- Add the script with defer attribute -->
    <script src="https://cdn.jsdelivr.net/npm/@superline-ai/agent-detection/dist/umd/index.umd.js" defer></script>
    ```
  </Tab>
</Tabs>

### Basic Usage

<Tabs>
  <Tab title="ES Modules">
    ```javascript theme={null}
    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);
    ```
  </Tab>

  <Tab title="Script Tag">
    ```html theme={null}
    <script defer>
      document.addEventListener('DOMContentLoaded', function() {
        // Initialize it
        AgentDetector.init({
          debug: false,
          autoStart: true,
          threshold: 0.6 // Optional: Set custom detection threshold (default: 0.5)
        });
        
        // Later, check if the session is from an agent
        AgentDetector.finalizeDetection()
          .then(result => {
            console.log('Is agent:', result.isAgent, 'Confidence:', result.confidence);
          });
      });
    </script>
    ```
  </Tab>
</Tabs>

## Integration with Analytics

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

```javascript theme={null}
// 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
});
```

<Card title="Analytics Integrations" icon="chart-line" href="/guides/google-analytics">
  Learn more about integrating with analytics platforms like Google Analytics and Mixpanel
</Card>

## Next Steps

<CardGroup cols={2}>
  <Card title="Core Concepts" icon="brain" href="/core-concepts/overview">
    Learn about the detection model and feature extraction system
  </Card>

  <Card title="API Reference" icon="code" href="/api-reference/agent-detector">
    Explore the complete API reference
  </Card>
</CardGroup>
