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

@chimekit/react

v0.1.0

Published

Official React components for ChimeKit in-app notifications

Readme

share

ChimeKit - React SDK

ChimeKit React SDK provides prebuilt notification UI and hooks for embedding the ChimeKit inbox in React apps. ChimeKit is a developer-first notification and product messaging infrastructure.

What you get:

  • Prebuilt inbox UI (popover, modal, drawer) with feed, preferences, and message details.
  • A client API for inbox data, metadata, and member preferences.
  • Hooks and context access for custom UI.
  • Theme tokens and class slots for styling.

Installation

npm install @chimekit/react
pnpm add @chimekit/react
yarn add @chimekit/react

Peer dependencies: react and react-dom.

Usage

1) Quickstart

import "@chimekit/react/styles.css";
// Tailwind (optional): if you want utilities to override ChimeKit styles,
// use your global CSS instead:
// @import "@chimekit/react/styles.css" layer(components);
import { ChimeKitProvider, Inbox } from "@chimekit/react";

const audienceMember = { id: "user_123" };

export function App() {
  return (
    <ChimeKitProvider
      publicKey="ck_pub_..."
      audienceMember={audienceMember}
      token="member_token"
    >
      <Inbox />
    </ChimeKitProvider>
  );
}

2) Provider setup and auth

ChimeKitProvider requires:

  • publicKey (your ChimeKit public key)
  • audienceMember (the logged-in user, at minimum { id: string })
  • either token or getToken

Optional provider props include baseUrl and onAuthError. baseUrl defaults to https://api.chimekit.com/member/v1.

audienceMember supports these optional fields: displayName, email, externalUserId, avatarUrl, and traits.

Dynamic token example:

import { ChimeKitProvider, Inbox } from "@chimekit/react";

const getToken = async () => {
  const response = await fetch("/api/chimekit/token");
  if (!response.ok) {
    throw new Error("Failed to fetch ChimeKit token");
  }
  const data = await response.json();
  return data.token;
};

<ChimeKitProvider
  publicKey="ck_pub_..."
  audienceMember={{ id: "user_123" }}
  getToken={getToken}
  onAuthError={(error) => {
    console.error("ChimeKit auth error", error);
  }}
>
  <Inbox variant="popover" />
</ChimeKitProvider>;

getToken can return a string or a promise. If a request returns a 401, the client clears the cached token and retries once; if the retry fails, onAuthError is called.

3) Accessing the client

import { useEffect } from "react";
import { useChimeKit } from "@chimekit/react";

export function UnreadCount() {
  const { client } = useChimeKit();

  useEffect(() => {
    void client.unreadCount().then((result) => {
      console.log(result.unreadCount);
    });
  }, [client]);

  return null;
}

Client methods:

  • listInbox, getMessage, unreadCount
  • markRead, markUnread, markAllRead
  • archive, archiveAll, unarchive
  • getMeta, getPreferences, updatePreferences
  • fetcher for custom member API calls

4) Components

Exports:

  • Provider: ChimeKitProvider
  • Inbox UI: Inbox, Bell, Feed
  • Preferences UI: Preferences, PreferencesDialog
  • Message UI: MessageDetails, MessageDetailsDialog

Inbox supports variant="popover" | "modal" | "drawer" and accepts labels, classes, and primaryColor for customization. Use bellProps, feedProps, messageDetailsProps, and preferencesProps to pass through component props.

Bell supports unread (boolean or number), size, renderIcon, and renderUnreadDot.

Feed supports type filters ("read" | "unread" | "archived" | "all") and optional category filtering.

5) Styling and theming

Import the stylesheet once. Tailwind users can keep the JS import; only use the layered @import if you want Tailwind utilities to override ChimeKit styles.

import "@chimekit/react/styles.css";
// Tailwind (optional): if you want utilities to override ChimeKit styles,
// use your global CSS instead:
// @import "@chimekit/react/styles.css" layer(components);

Theme with CSS variables on :root or .chimekit-theme:

.chimekit-theme {
  --chimekit-color-primary: #0ea5e9;
  --chimekit-font-sans: "Inter", system-ui, sans-serif;
  --chimekit-radius: 0.5rem;
  --chimekit-bg: #ffffff;
  --chimekit-fg: #0f172a;
}

Dark mode is supported via .dark .chimekit-theme or prefers-color-scheme: dark with the default tokens.

Slot-level class overrides are available through the classes props. Example:

<Inbox
  classes={{ root: "my-inbox", header: "my-inbox-header" }}
  bellProps={{ className: "my-bell" }}
/>

6) Message actions and HTML

Messages can include link actions or callback actions. Use onActionCallback to handle callback actions. MessageDetails renders HTML and accepts sanitizeHtml to customize sanitization.

import { MessageDetails } from "@chimekit/react";

<MessageDetails
  messageId="msg_123"
  sanitizeHtml={(html) => html}
  onActionCallback={(actionId) => {
    console.log("Action clicked", actionId);
  }}
/>;

Documentation

Full Client SDK documentation can be found here: https://docs.chimekit.com/client-sdks

License

MIT License - see LICENSE for details.