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

@cherry_ai/react

v0.6.0

Published

React components for rendering ads from the @cherry_ai/api engine: click-through cards and lead-form units, with built-in impression/click tracking, disclosure, and feedback controls.

Readme

@cherry_ai/react

React components for Cherry ads: click-through cards and lead-form units, with impression/click tracking, disclosure, and feedback controls.

Pair with @cherry_ai/api — fetch ads on the server, render them here.

Install

Peer dependencies: react and react-dom >=18.

pnpm add @cherry_ai/react
npm install @cherry_ai/react

Import styles once in your app:

import "@cherry_ai/react/styles.css";

Override --cherry-* custom properties on any ancestor (e.g. :root) to theme the cards.

Render an ad

import { CherryAd } from "@cherry_ai/react";
import "@cherry_ai/react/styles.css";

export function ResponseAds({ ads }: { ads: Array<{ adText: string; adId?: string; placement: string; placementId: string }> }) {
  return (
    <>
      {ads.map((ad) => (
        <CherryAd
          key={ad.placementId}
          ad={ad}
          sessionId={chatSession.id}
          fallback={null}
        />
      ))}
    </>
  );
}

CherryAd picks the renderer from the ad payload. A lead-form ad without sessionId and apiKey degrades to a click-through card.

Optional adId on each ad is the stable catalog identity from getAds(). Pass it through so impression and click events can be attributed to a specific creative.

| Prop | Type | Description | |------|------|-------------| | ad | Ad \| null \| undefined | Object from cherry.getAds(). Renders fallback when empty. | | sessionId | string | Required for lead-form ads and feedback. | | apiKey | string | Required for lead-form ads. Pass from your server, not a client env var. | | feedbackUrl | string | Your backend feedback endpoint. Omit to hide thumbs up/down. | | fallback | ReactNode | Rendered when there is no ad. Keep this cheap. | | onImpression / onClick / onFeedback | callbacks | Optional analytics hooks. Beacons still fire independently. |

Tracking

Impression and click billing uses the server-issued impUrl and clickUrl beacons returned by getAds(). The pixel fires them automatically once an ad is viewable (impression) or clicked — no client-side endpoint configuration required.

  • impUrl — GET beacon recorded by api.cherry (/ack?p=…)
  • clickUrl — GET beacon recorded by api.cherry (/track?p=…); navigation goes to ad.url

Optional local analytics via initPixel or CherryProvider:

import { CherryProvider } from "@cherry_ai/react";

<CherryProvider pixelId="my-site" debug onEvent={(e) => console.log(e)}>
  {children}
</CherryProvider>

The deprecated endpoint option (formerly POST /ads/track) is no longer used for billing.

Custom renderers

Most apps only need CherryAd. For a fully custom unit, export CherryClickAd, CherryLeadFormAd, AdSlot, AdDisclosure, and useImpressionTracking / trackClick / submitFeedback.

Development

Run from this repo (pkg.react.cherry):

pnpm install
pnpm check
pnpm test
pnpm build

Releasing

Changesets live in this repo only. Until 1.0.0: patch = fix, minor = feature or breaking, major = 1.0.0.

pnpm changeset              # add a changeset on a feature branch
pnpm changeset:status       # preview the bump

On merge to main, CI opens a chore: update version PR (pnpm changeset:version). Merging that PR publishes to npm (pnpm changeset:publish), tags vX.Y.Z, and creates a GitHub Release. Set the GitHub Actions secret NPM_TOKEN.