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

@maebgch/rcs-emulator

v0.1.14

Published

A production-ready React component library for emulating RCS Business Messaging (RBM) device UI

Readme

RCS Emulator React Package

Reusable, production-ready emulator UI for RCS Business Messaging (RBM). Ships as a React component with typed props, RBM JSON helpers, and bundled styles.

Features

  • Drop-in RcsEmulator component for RBM flows (light/dark themes, Android/iOS chrome)
  • Accepts inline RBM JSON or fetches from a jsonUrl
  • Emits structured UserReplyPayload callbacks for replies/actions (including WebView handling)
  • Ships typed helpers and guards (validateConversationFlow, useJsonFetch, RBM schema types)
  • Bundled CSS (dist/style.css) generated from Tailwind classes—no Tailwind setup required in consumer apps

Installation

npm install @maebgch/rcs-emulator
# or
pnpm add @maebgch/rcs-emulator
# or
yarn add @maebgch/rcs-emulator

Quick Start

import {
  RcsEmulator,
  type RbmConversationFlow,
  type UserReplyPayload,
} from "@maebgch/rcs-emulator";
import "@maebgch/rcs-emulator/style.css";

const flow: RbmConversationFlow = {
  name: "Coffee Bot",
  conversation: [
    {
      id: "welcome",
      message: {
        text: "Welcome to Coffee Bot! Ready for a pick-me-up?",
      },
      suggestions: [
        {
          reply: { text: "Yes, show me options", postbackData: "coffee_yes" },
        },
        {
          reply: { text: "Maybe later", postbackData: "coffee_later" },
        },
      ],
      nextMessageIds: ["options", "bye"],
    },
    {
      id: "options",
      message: {
        richCard: {
          title: "Today's Specials",
          description: "Pick a drink to order",
          media: { url: "https://placehold.co/600x400", height: "medium" },
        },
      },
      suggestions: [
        { reply: { text: "Latte", postbackData: "latte" } },
        { reply: { text: "Cold Brew", postbackData: "cold_brew" } },
      ],
    },
    {
      id: "bye",
      message: { text: "No worries—text me anytime for coffee!" },
    },
  ],
};

export default function App() {
  const handleReply = (payload: UserReplyPayload) => {
    console.log("User interaction", payload);
  };

  return (
    <RcsEmulator
      messages={flow}
      onUserReply={handleReply}
      theme="light"
      device="android"
      showLockScreen={false}
    />
  );
}

API Reference

Props

  • messages?: RbmConversationFlow – Inline RBM JSON (provide this OR jsonUrl)
  • jsonUrl?: string – Remote RBM JSON to fetch
  • onUserReply: (payload: UserReplyPayload) => void – Interaction callback
  • theme?: "light" | "dark" – Default light
  • device?: "android" | "ios" – Default android
  • businessInfo?: BusinessInfo – Branding overrides (name, logo, brandColor, etc.)
  • className?: string – Extra container classes
  • width?: number / height?: number – Emulator frame size (defaults 375x667)
  • showSuggestions?: boolean – Toggle suggestion chips
  • showLockScreen?: boolean – Start on lock screen preview

Callback Payload

UserReplyPayload includes { type: "reply" | "action", postbackData, displayText, actionData?, timestamp }. WebView actions surface actionData: { type: "webview", url, viewMode, description? }.

Additional Exports

  • Helpers: validateConversationFlow, getFirstMessagePreview
  • Hooks: useJsonFetch
  • RBM types & guards: RbmConversationFlow, RbmMessage, isSuggestedReply, isSuggestedAction, isWebViewAction, getWebViewConfig
  • Standalone component: WebViewRenderer

RBM JSON Schema

  • Use RbmConversationFlow type as the schema reference
  • Each node supports text, rich cards, carousels, suggestions, and optional branching via nextMessageIds
  • See TypeScript types in src/components/RcsEmulator/types/rbm.types.ts for full schema

Usage Examples

Basic Usage

import { RcsEmulator } from "@maebgch/rcs-emulator";
import "@maebgch/rcs-emulator/style.css";

function App() {
  return (
    <RcsEmulator
      jsonUrl="https://example.com/conversation.json"
      onUserReply={(payload) => console.log(payload)}
    />
  );
}

With Custom Theme and Device

<RcsEmulator
  messages={conversationFlow}
  onUserReply={handleReply}
  theme="dark"
  device="ios"
  width={414}
  height={896}
/>

With Business Branding

<RcsEmulator
  messages={conversationFlow}
  onUserReply={handleReply}
  businessInfo={{
    name: "My Business",
    logo: "https://example.com/logo.png",
    brandColor: "#FF5733",
  }}
/>

License

MIT