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/vercel

v0.1.0

Published

Next.js middleware integration for Inception Agents. Detects AI agent traffic at the edge and serves optimized content without affecting human visitors.

Readme

@inception-agents/vercel

Next.js middleware integration for Inception Agents. Detects AI agent traffic at the edge and serves optimized content without affecting human visitors.

Installation

npm install @inception-agents/vercel

Peer dependency: next >= 14.0.0

Quick Start

Create or update your middleware.ts at the project root:

import { withInception } from '@inception-agents/vercel';

export const middleware = withInception({
  apiKey: process.env.INCEPTION_API_KEY!,
});

export const config = {
  matcher: ['/((?!_next/static|_next/image|favicon.ico).*)'],
};

That's it. Human traffic passes through untouched. AI agents receive optimized content automatically.

API Reference

withInception(options)

Creates a Next.js-compatible middleware function that wraps the full Inception pipeline. When the pipeline returns optimized content, that response is served directly. Otherwise, Next.js continues handling the request normally.

import { withInception } from '@inception-agents/vercel';

export const middleware = withInception({
  apiKey: process.env.INCEPTION_API_KEY!,
  bypassPaths: ['/api/webhooks'],
});

Returns: (request: Request) => Promise<Response> — a function compatible with Next.js middleware.ts export.

createInceptionMiddleware(options)

Lower-level alternative that returns null for human traffic instead of a pass-through response. Useful when you need to compose with other middleware.

import { createInceptionMiddleware } from '@inception-agents/vercel';
import { NextResponse } from 'next/server';

const inception = createInceptionMiddleware({
  apiKey: process.env.INCEPTION_API_KEY!,
});

export async function middleware(request: Request) {
  const agentResponse = await inception(request);
  if (agentResponse) return agentResponse;

  // Your custom middleware logic here
  return NextResponse.next();
}

Returns: (request: Request) => Promise<Response | null>

Configuration

VercelMiddlewareOptions

Extends InceptionConfig from @inception-agents/core.

| Option | Type | Default | Description | |--------|------|---------|-------------| | apiKey | string | required | Your Inception Agents API key | | bypassPaths | string[] | [] | Additional paths to skip (beyond core defaults) | | debug | boolean | false | Enable debug logging | | excludePaths | string[] | ['/api/', '/_next/', ...] | Paths that bypass detection | | detectionThreshold | number | 0.7 | Minimum confidence to classify as agent | | cacheMaxAge | number | 300 | Cache-Control max-age (seconds) | | enableLlmsTxt | boolean | true | Serve /llms.txt and /llms-full.txt | | enableJsonLd | boolean | true | Serve JSON-LD enrichment for agents | | enableAgentCard | boolean | false | Serve /.well-known/agent.json |

Exported Types

  • InceptionConfig — Base configuration interface
  • AgentDetectionResult — Detection result with agent identity and confidence
  • IntentClassification — Classified agent intent
  • VercelMiddlewareOptions — Vercel-specific options extending InceptionConfig

How It Works

  1. Every request passes through the middleware at the Vercel edge
  2. The Inception pipeline checks the request for AI agent signals (user-agent, IP range, headers)
  3. If an agent is detected above the confidence threshold, optimized content is served directly
  4. If the visitor is human, the middleware passes through with zero latency impact
  5. Analytics signals are collected asynchronously (fire-and-forget)

Related