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

v0.2.2

Published

Brudcast for React Native: sessions, identity and events, with in-app messaging and push in their own packages.

Readme

@brudcast/react-native

npm CI License: Apache 2.0

The Brudcast SDK for React Native: sessions, identity, events and deep link handling for in-app messaging and push notifications. It runs the native Android and iOS SDKs, so storage, networking, the event queue, triggers and message rendering are the same code a native app runs.

Features

  • Identify signed-in users with a hash computed on your server, and forget them on logout.
  • Record events and screens that trigger in-app messages and segment users.
  • Route deep links, URLs and custom events from messages and push taps to your app's router, including the tap that launches the app.
  • Consent controls: opt out of campaign messages, or stop all event collection.
  • Every call is safe before initialize, and nothing throws into your app.

Add the module packages for the channels you use:

| Package | Adds | | ---------------------------------------------------------------------------------------------- | ------------------------------------------------------------- | | @brudcast/react-native-in-app | In-app messages, the inbox, its hooks and an entry view | | @brudcast/react-native-push | Push notifications through @react-native-firebase/messaging |

A push-only app adds @brudcast/react-native-push alone and never ships the in-app renderer.

Platform support

| React Native | Android | iOS | Expo | | -------------------------------- | ---------------- | -------------- | ---------------------------- | | 0.86 and later, New Architecture | API 24 and later | 15.1 and later | SDK 57 and later, dev builds |

The packages are TurboModules and Fabric components only; the legacy architecture is not supported. Expo Go cannot load them. Web and Windows are not supported.

Getting started

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

List every Brudcast package your app uses in its own package.json: autolinking only links direct dependencies. In an Expo app, add @brudcast/react-native-push to plugins (see its README) and run npx expo prebuild.

Start the SDK once, before the first render, in index.js:

import { Brudcast } from '@brudcast/react-native';
import { BrudcastInApp } from '@brudcast/react-native-in-app';
import { BrudcastPush } from '@brudcast/react-native-push';

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

The publishable key (bpk_...) is in the dashboard under the in-app application. It is public by design. Never ship the identity secret in the app.

Usage

Identify the user

await Brudcast.identify(user.id, {
  userHash: user.brudcastHash,
  traits: { email: user.email, firstName: user.firstName },
});

await Brudcast.reset();

userHash is hex(HMAC-SHA256(identitySecret, user.id)), computed on your server and sent to the app at sign-in. It is required when the application enforces identity verification. Call reset on logout: the device keeps its id, and its push token stops reaching the previous user.

Events and screens

Brudcast.track('checkout_started', { total: 120, product: 'sneakers' });
Brudcast.screen('Checkout');

Names start with a letter and hold up to 64 letters, digits and _ . : -. Properties hold strings, numbers, booleans and nulls; anything else is dropped with a warning.

Deep links and custom events

Messages and push taps can open a deep link, open a URL or fire a custom event. By default the SDK opens the link. Set an action handler to route it yourself:

Brudcast.setActionHandler(async (action) => {
  if (action.kind === 'deeplink' && router.canOpen(action.value)) {
    router.open(action.value);
    return 'handled';
  }
  return 'useDefault';
});

Set it next to initialize: a push tap that launched the app waits up to five seconds for it. The handler has two seconds to answer, after which the default runs. On Android, action.verified is false for a push tap the SDK cannot prove it created; check it before opening a private screen.

Consent

Brudcast.optOut();
Brudcast.optIn();
Brudcast.disableTracking();
Brudcast.enableTracking();

optOut stops campaign in-app messages for the user; transactional messages still arrive. disableTracking stops collecting and sending events altogether and discards waiting ones.

Environments

import { localEnvironment, customEnvironment } from '@brudcast/react-native';

Brudcast.initialize('bpk_...', { environment: 'staging' });
Brudcast.initialize('bpk_...', { environment: localEnvironment({ port: 8191 }) });
Brudcast.initialize('bpk_...', {
  environment: customEnvironment('https://in-app.example.com/sdk/v1'),
});

localEnvironment reaches the service on the development machine: localhost from the iOS simulator, 10.0.2.2 from the Android emulator.

Additional information

  • Versions. Keep every Brudcast package on the same version; the module packages require the exact core version. The changelog names the native SDK version each release runs.
  • Dev reloads. Handlers set from JavaScript are dropped when the bundle reloads and set again by your startup code. Messages and taps that were waiting on the old bundle get the default.
  • Example. A complete app is in example.
  • Documentation: docs.brudcast.com.
  • Security: report vulnerabilities as SECURITY.md describes, never in a public issue.
  • License: Apache License 2.0.