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

@cherrydotfun/chat-embed-sdk

v0.1.6

Published

Embed Cherry Chat public rooms into any website. Wallet-based auth, full theming, lightweight iframe-based.

Readme

@cherrydotfun/chat-embed-sdk

Embed Cherry Chat rooms into any website: a lightweight iframe widget with wallet-based auth, full theming, and real-time messaging. Works with any bundler or straight from a <script> tag.

Live demo

Try it: cherry.fun/chat-embed-example — theme presets, display modes (inline / floating / collapsible / resizable), and a live theme editor, all embedded into a real Cherry chat room. Its "Show the integration snippet" button gives you copy-paste code.

Cherry Embed wallet-only demo — theme editor on the left, live chat on the right

Full documentation lives at portal.cherry.fun/docs.

Install

npm install @cherrydotfun/chat-embed-sdk

Or, for a plain HTML site, load the package from npm via jsDelivr (the bundle exposes window.CherryEmbedSDK):

<script src="https://cdn.jsdelivr.net/npm/@cherrydotfun/[email protected]/dist/index.global.js"></script>

Before you start

You need a Cherry embed, created self-serve at portal.cherry.fun:

  1. Sign in with your Solana wallet (SIWS — no email/password, nothing goes onchain).
  2. Create a Project, then open Chat embedsNew embed.
  3. Copy the embed ID (your appId), add your site's origin under Allowed origins, and make sure the embed is enabled.

An embed only loads on allow-listed origins while enabled — add http://localhost:3000 (or your dev origin) before testing locally.

Quickstart (no backend)

The default wallet-only mode needs nothing but an appId and a public room. The iframe owns the entire wallet flow: visitors click "Connect wallet", sign a challenge, and chat — no token endpoint, no host wallet integration.

import { CherryEmbed } from '@cherrydotfun/chat-embed-sdk';

const chat = new CherryEmbed({
  appId: 'YOUR_EMBED_ID',
  container: '#cherry-chat',
  roomId: 'YOUR_ROOM_ID',
  theme: { mode: 'dark', primaryColor: '#FF5BA8' },
});

await chat.mount();
<div id="cherry-chat" style="height: 600px"></div>

Prefer a floating panel instead of an inline one? Omit container and set a position:

const chat = new CherryEmbed({
  appId: 'YOUR_EMBED_ID',
  roomId: 'YOUR_ROOM_ID',
  position: 'floating-right',
});
await chat.mount();

Pass collapsed: true to start hidden — the widget has no built-in launcher button, so wire your own control to chat.toggle() / chat.show().

Authenticating your own users

If you run a backend and want chat identity tied to your users, use app-trusted + wallet auth: your backend signs a short-lived embedToken (HMAC, using the app secret from your embed's settings), and the user confirms wallet ownership with one signature. See Authentication for the full flow, and example/app-trusted+wallet/ for a complete runnable token server.

const chat = new CherryEmbed({
  appId: 'YOUR_EMBED_ID',
  container: '#cherry-chat',
  token,          // minted by your backend
  walletAddress,  // the user's connected wallet
  signChallengeHandler: async (message) => {
    // message: Uint8Array — sign it with the user's wallet, return Uint8Array
    return await wallet.signMessage(message);
  },
});
await chat.mount();

Documentation

The portal docs are the source of truth for the SDK surface:

Mobile (React Native / Flutter)

The SDK is browser-only (document/iframe/window.postMessage), so it can't run directly in a mobile runtime. Run it inside a WebView (react-native-webview or webview_flutter) on a small host page, and bridge wallet signing to the native layer (Mobile Wallet Adapter on Android / deeplink on iOS) — there's no window.phantom in a mobile WebView. Don't point the WebView straight at embed.cherry.fun: the bridge rejects when window.parent === window, so the embed must be nested in an iframe on a host page. One host page serves both platforms (it auto-detects the bridge).

Full guide: docs/react-native.md. Runnable code (hosted + bundled host page): example/react-native/ · example/flutter/.

Examples

Development

npm install
npm run build      # tsup → dist/ (ESM, CJS, IIFE global build)
npm test           # vitest
npm run typecheck  # tsc --noEmit

Support

  • Documentation: https://portal.cherry.fun/docs
  • GitHub issues: https://github.com/cherrydotfun/chat-embed-sdk/issues
  • Cherry team: reach out via portal.cherry.fun

License

MIT — see LICENSE.