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

@brudcast/react-native-in-app

v0.2.2

Published

Brudcast in-app messaging for React Native: native messages, the inbox, hooks and an inbox message view.

Readme

@brudcast/react-native-in-app

npm CI License: Apache 2.0

In-app messaging for the Brudcast React Native SDK. Messages are drawn natively, over any screen, by the same renderer native apps use.

Features

  • Modals, banners and full-screen messages, triggered by events, screens and segments, offline too.
  • Hold messages back during checkout or a video, and decide per message whether it shows.
  • Draw messages yourself and report impressions, clicks and dismissals.
  • The inbox: the native inbox screen, or your own built with useInbox, and a live unread count.
  • <BrudcastInboxMessage>, an inbox entry drawn by the native renderer with its buttons working.

Getting started

yarn add @brudcast/[email protected] @brudcast/[email protected]
cd ios && pod install

Set up @brudcast/react-native, then add the module when you initialise:

import { BrudcastInApp, BrudcastMessageDecision } from '@brudcast/react-native-in-app';

Brudcast.initialize('bpk_...', { modules: [BrudcastInApp.module] });

Importing the package also adds Brudcast.inApp, the same object as BrudcastInApp.

Usage

Control display

BrudcastInApp.pauseDisplay();
BrudcastInApp.resumeDisplay();

BrudcastInApp.setMessageHandler(async (message) => {
  if (isRecording) return BrudcastMessageDecision.Defer;
  return BrudcastMessageDecision.Show;
});

The handler answers Show, Suppress (not for this trigger), Defer (wait for the next trigger) or Custom (draw it yourself) within two seconds, after which the message shows. The strings 'show', 'suppress', 'defer' and 'custom' work too. For Custom, report what happened with reportImpression(id), reportClick(id, buttonId) and reportDismiss(id); designDocument(message) decodes the design.

The inbox

BrudcastInApp.inbox.present({ title: 'Inbox' });

function InboxBadge() {
  const unread = useInboxUnreadCount();
  return unread > 0 ? <Badge count={unread} /> : null;
}

function Inbox() {
  const inbox = useInbox({ pageSize: 20 });
  return (
    <FlatList
      data={inbox.messages}
      keyExtractor={(message) => message.id}
      renderItem={({ item }) => <Row message={item} onPress={() => inbox.markRead(item)} />}
      onEndReached={inbox.loadMore}
      refreshing={inbox.isLoading}
      onRefresh={inbox.refresh}
    />
  );
}

useInbox loads the first page on mount and keeps messages, hasMore, isLoading, error and unreadCount. markRead and remove update the list at once and tell the service on every device. Without hooks, BrudcastInbox.list({ before, limit }) returns a page and throws a BrudcastInboxError when it cannot load one.

Draw an entry natively

<BrudcastInboxMessage message={message} />

It takes the width it is given and sizes its height to the design. Pass expand to fill the space instead. The message must come from list or useInbox. Each one runs the renderer, so build long lists from title, preview and thumbnailUrl, and use it for the detail screen.

Additional information

  • Versions. Keep this package on the same version as @brudcast/react-native.
  • Documentation: docs.brudcast.com.
  • License: Apache License 2.0.