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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@inception-agents/browser

v0.1.0

Published

Lightweight client-side beacon (<5 KB) for tracking AI agent referral attribution. Detects when users arrive from AI platforms (ChatGPT, Perplexity, Claude, Gemini, Copilot, and more) and fires attribution events to the Inception Agents analytics API.

Downloads

64

Readme

@inception-agents/browser

Lightweight client-side beacon (<5 KB) for tracking AI agent referral attribution. Detects when users arrive from AI platforms (ChatGPT, Perplexity, Claude, Gemini, Copilot, and more) and fires attribution events to the Inception Agents analytics API.

Installation

Script Tag (recommended for most sites)

<script
  src="https://cdn.inceptionagents.com/beacon.js"
  data-api-key="iak_your_api_key"
  data-tenant-id="t_your_tenant_id"
></script>

The script auto-initializes from data-* attributes. No additional JavaScript required.

npm

npm install @inception-agents/browser
import { init } from '@inception-agents/browser';

init({
  apiKey: 'iak_your_api_key',
  tenantId: 't_your_tenant_id',
});

API Reference

init(config)

Initialize the browser beacon. Automatically detects AI referrals from document.referrer and UTM parameters, then fires an attribution event if an AI source is detected.

init({
  apiKey: 'iak_your_api_key',
  tenantId: 't_your_tenant_id',
  debug: true, // Log events to console
});

Options:

| Option | Type | Default | Description | |--------|------|---------|-------------| | apiKey | string | required | Your Inception Agents API key | | tenantId | string | — | Your tenant ID | | apiUrl | string | https://inception-agents-api... | API base URL | | debug | boolean | false | Log referral events to the browser console |

Script Tag Attributes

| Attribute | Description | |-----------|-------------| | data-api-key | Your Inception Agents API key (required) | | data-tenant-id | Your tenant ID | | data-api-url | Custom API base URL | | data-debug | Enable debug logging (presence enables) |

Detected AI Platforms

The beacon detects referrals from these AI platforms via document.referrer:

  • ChatGPTchat.openai.com, chatgpt.com
  • Perplexityperplexity.ai
  • Claudeclaude.ai
  • Geminigemini.google.com
  • Copilotcopilot.microsoft.com
  • You.comyou.com
  • Phindphind.com
  • Kagikagi.com

Additionally, UTM parameters are checked for AI-attributed sources: utm_source=chatgpt, utm_source=perplexity, utm_source=claude, utm_source=gemini, utm_source=copilot, utm_source=ai-agent.

How It Works

  1. On page load, the beacon checks document.referrer against known AI platform domains
  2. It also checks URL parameters for AI-attributed utm_source values
  3. If an AI referral is detected, an attribution event is sent to the Inception Agents API
  4. Events are sent via navigator.sendBeacon() (with fetch fallback) for reliability
  5. A session ID is persisted in sessionStorage to group events within a session
  6. Only AI referrals fire events to minimize noise

Builds

The package ships two build formats:

  • ESM (dist/index.mjs) — For npm/bundler usage with import
  • IIFE (dist/index.global.js) — For script tag usage, exposes window.InceptionAgents

Exported Types

  • BeaconConfig — Configuration for init()
  • ReferralEvent — Shape of the attribution event sent to the API

Related