npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@superline-ai/agent-detection

v0.0.8

Published

Agent detection library for detecting AI agents using browser automation

Readme

Superline Agent Detection

npm version License

A lightweight, high-performance library for detecting AI agents in real-time from browser sessions based on browser environment metadata and behavioral patterns.

NPM Package: https://www.npmjs.com/package/@superline-ai/agent-detection

Note: This is an early version of the library and is not yet recommended for production use.

Overview

Superline Agent Detection analyzes a session on a website in real-time to distinguish between human users and AI agents. The library extracts features from browser metadata and behavioral data (mouse movements, keyboard patterns, scroll behavior, clicks) and processes them through a logistic regression model to calculate detection probability.

Built on data from hundreds of thousands of labeled browser sessions, the detection system is continuously improved with new findings and for better reliability. The library is designed to have minimal performance impact while providing reliable detection results.

Detection results can be used to differentiate between humans and agents in your analytics and A/B testing setups, ensuring your metrics reflect actual human behavior and your experiments target the right audience.

Documentation

For comprehensive documentation, API references, and integration guides, visit our official documentation:

docs.superline.ai

Installation

NPM, Yarn, or PNPM

npm install @superline-ai/agent-detection
# or
yarn add @superline-ai/agent-detection
# or
pnpm add @superline-ai/agent-detection

Script Tag

Add directly to your HTML head:

<!-- Add the script with defer attribute -->
<script src="https://cdn.jsdelivr.net/npm/@superline-ai/agent-detection/dist/umd/index.umd.js" defer></script>

<!-- Initialize it with defer as well -->
<script defer>
  document.addEventListener('DOMContentLoaded', function() {
    // The library exposes a global agentDetector object
    window.agentDetector.init({
      debug: false,
      autoStart: true
    });
    
    // Later, check if the session is from an agent
    window.agentDetector.finalizeDetection()
      .then(result => {
        console.log('Is agent:', result.isAgent, 'Confidence:', result.confidence);
      });
  });
</script>

Quick Start

Getting started with Superline Agent Detection is simple:

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

// Initialize the detector (pre-instantiated)
AgentDetector.init({
  debug: false,
  autoStart: true
});

// 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
// Send the agent detection result to your analytics platform
if (result.isAgent) {
  // Example with Google Analytics 4
  gtag('set', 'user_properties', {
    is_agent: true,
    agent_confidence: result.confidence
  });
  
  // Example with Mixpanel
  mixpanel.people.set({
    'Is Agent': true,
    'Agent Confidence': result.confidence
  });
}

That's it! The library will begin collecting behavioral patterns and provide detection results.

Roadmap

Currently, the library is "open weights" - providing the trained model weights for detection. We're actively working on several improvements to make the agent detection more powerful and versatile:

  • More sophisticated feature extraction and benchmarks for reliable detection
  • Releasing the complete end-to-end stack including:
    • Data collection library for gathering browser sessions
    • Feature exploration tools and analytics
    • Training pipeline (Python ML codebase)
    • Detection system
  • End-to-end system for custom training and detection

Community & Support

Join our Discord community to connect with other developers, ask questions, and share your experiences:

Join the Superline Discord

License

This project is licensed under the MIT License - see the LICENSE file for details.

Changelog

For a detailed changelog and release history, please refer to our GitHub Releases page.