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

@adzenai/ai

v1.1.1

Published

AI-powered ad integration for CopilotKit and AG-UI agents

Readme

@adzenai/ai

AI-powered ad integration for CopilotKit and AG-UI agents. Delivers contextual sponsored placements inside AI chat streams without modifying or delaying assistant responses.

Install

npm install @adzenai/ai @adzenai/core

Prerequisites

You need an Adzen API key. Contact Adzen to set up a publisher account and obtain your key.

Quick Start

Server-side: pipe AG-UI events through the middleware

import { AdzenAsyncMiddleware } from "@adzenai/ai/copilotkit";

const adzen = new AdzenAsyncMiddleware({
  apiKey: process.env.ADZEN_API_KEY!,
  location: process.env.ADZEN_LOCATION,
});

for await (const event of agentEventStream) {
  const downstream = await adzen.processEvent(event);
  for (const evt of downstream) {
    emitToClient(evt);
  }
}

Client-side: render ad cards

import { AdzenCard, dispatchPlacementEvents } from "@adzenai/ai/copilotkit/react";

// Bridge AG-UI placement events to the browser
dispatchPlacementEvents(events);

// Render below each assistant message
<AdzenCard messageId={msg.id} />

AdzenCard returns null when no ad is available — safe to render unconditionally.

Exports

| Path | Environment | Provides | | --- | --- | --- | | @adzenai/ai | Any | Core type re-exports (AdzenPlacement, ProcessResponse, ProcessResponseAd) | | @adzenai/ai/copilotkit | Server or client | AdzenAsyncMiddleware, AdzenAsyncConfig | | @adzenai/ai/copilotkit/react | Browser (React 18+) | AdzenCard, useAdzenPlacement, dispatchPlacementEvent(s) |

How It Works

  1. AdzenAsyncMiddleware buffers assistant text from AG-UI events.
  2. On message completion, it calls the Adzen /process API to match a contextual ad.
  3. If matched, an adzen_placement custom event is appended to the downstream stream.
  4. dispatchPlacementEvents() bridges these to browser CustomEvents.
  5. AdzenCard picks up the placement and renders it with automatic impression tracking.

Impression beacons are fired as client-side GET requests directly to the delivery API — no server-side proxy needed.

The middleware is additive only — it never modifies, blocks, or delays the original event stream. All failures degrade silently.

Configuration

new AdzenAsyncMiddleware({
  apiKey: string;           // required — Adzen API key
  endpointUrl?: string;     // default: "https://api.adzen.ai/v1/ai"
  timeoutMs?: number;       // default: 3000
  adUnitPosition?: string;  // default: "chin"
  location?: string;        // optional — DMA location code for geo-targeting
  conversationId?: string;  // optional — links impressions to conversation context
});

License

MIT