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

bridgefy-react-native

v1.1.9

Published

Bridgefy React Native Library

Readme

Bridgefy React Native SDK

GitHub last commit GitHub issues

The Bridgefy Software Development Kit (SDK) is a state‑of‑the‑art plug‑and‑play solution that enables offline communication in your mobile apps by using Bluetooth mesh networks.

Integrate the Bridgefy SDK into your Android and iOS app to reach users who don't always have a reliable Internet connection and keep engagement high even in challenging environments.

Website: https://bridgefy.me/sdk Email: [email protected] Twitter: https://twitter.com/bridgefy Facebook: https://www.facebook.com/bridgefy


Operation mode

Bridgefy automatically manages device discovery and connections to create a mesh network, whose size depends on the number of nearby devices and environmental conditions. This mesh allows messages to hop across multiple devices, letting nodes in the same cluster or in different clusters exchange data without Internet access.

networking


Platform permissions

Before using the SDK in a React Native app, configure the required permissions at the native level for each platform.


Installation

Install the SDK via npm or Yarn.

npm i bridgefy-react-native
# or
yarn add bridgefy-react-native

Usage

Initialization

Use initialize to configure the Bridgefy SDK with your API key and base options.

import { Bridgefy, BridgefyPropagationProfile } from 'bridgefy-react-native';

const bridgefy = new Bridgefy();

export default function App() {
  React.useEffect(() => {
    bridgefy
      .initialize({
        apiKey: 'your-api-key-here', // UUID - Your Bridgefy license key.
        verboseLogging: false,       // Enables or disables verbose logs.
        operationMode: 'hybrid',     // foreground | background | hybrid
      })
      .catch((error) => {
        console.error(error);
      });
  }, []);
}

Starting and stopping the SDK

Once initialized, you can start or stop the SDK as needed.

/**
 * Start Bridgefy SDK operations
 */
bridgefy.start(
  userId,              // Optional UUID - Custom user identifier in the network.
  propagationProfile,  // Optional BridgefyPropagationProfile - Message propagation profile.
);

/**
 * Stop Bridgefy SDK operations
 */
bridgefy.stop();

Sending data

Use send to transmit serialized string data using a transmission mode.

async function sendData() {
  const userId = await bridgefy.currentUserId();
  const lastMessageId = await bridgefy.send(
    'data', // String-encoded data to send.
    {
      type: BridgefyTransmissionModeType.broadcast,
      uuid: userId,
    },
  );
}

The method returns a message UUID you can use for tracking or acknowledgement flows.


Handling SDK events

Bridgefy emits lifecycle and messaging events through React Native's NativeEventEmitter. Subscribe to events to track startup, incoming messages, errors, and other state changes.

React.useEffect(() => {
  const subscriptions: EmitterSubscription[] = [];
  const eventEmitter = new NativeEventEmitter(
    NativeModules.BridgefyReactNative
  );

  // Fired when the Bridgefy SDK has started successfully.
  subscriptions.push(
    eventEmitter.addListener(BridgefyEvents.bridgefyDidStart, (event) => {
      console.log('Bridgefy started', event);
    })
  );

  // Fired when this device receives data from another Bridgefy device.
  subscriptions.push(
    eventEmitter.addListener(
      BridgefyEvents.bridgefyDidReceiveData,
      (event) => {
        console.log('Bridgefy received data', event);
      }
    )
  );

  return () => {
    for (const sub of subscriptions) {
      sub.remove();
    }
  };
}, []);

For a complete list of available events, see the BridgefyEvents enum in the SDK API reference.


Additional functionality

The Bridgefy class exposes several helper methods to manage sessions, connectivity, and licensing.

  • destroySession(): Destroys the current SDK session and cleans local state.
  • establishSecureConnection(userId: string): Promise<void>: Establishes an end-to-end encrypted connection with the specified peer.
  • currentUserId(): Promise<string>: Returns the current device's user identifier.
  • connectedPeers(): Promise<string[]>: Returns the list of currently connected peers.
  • licenseExpirationDate(): Promise<Date>: Returns the configured license expiration date.
  • updateLicense(): Promise<void>: Refreshes the SDK license (for renewed or upgraded plans).
  • isInitialized(): Promise<boolean>: Indicates whether the SDK has been initialized.
  • isStarted(): Promise<boolean>: Indicates whether the SDK is currently running.

Operation mode control

These methods let you inspect and change how Bridgefy runs at runtime.

  • setOperationMode(config: BridgefyOperationModeConfig): Promise<BridgefyOperationModeConfig>
  • getOperationMode(): Promise<BridgefyOperationModeConfig>
  • switchToBackground(): Promise<void>
  • switchToForeground(): Promise<void>
  • getOperationStatus(): Promise<BridgefyOperationModeStatus>

Always handle promises and error cases to keep your networking layer robust and responsive.


Bridgefy propagation profiles

The BridgefyPropagationProfile enum defines presets for how messages propagate through the mesh, so you can tune behavior to your use case.

  • STANDARD: Balanced default profile for general messaging.
  • HIGH_DENSITY_NETWORK: Optimized for crowded environments such as concerts or stadiums.
  • SPARSE_NETWORK: Suitable for rural or low-density areas.
  • LONG_REACH: Prioritizes maximum distance, useful for emergencies or outdoor activities.
  • SHORT_REACH: Focuses on nearby devices only.
  • REALTIME: Prioritizes ultra-low latency for time-sensitive notifications.

Background/foreground operation modes guide

Bridgefy supports three main operation modes with different trade-offs in availability and battery usage.

  1. FOREGROUND mode
  • SDK runs only while the app is in the foreground.
  • No persistent background service.
  • Lower battery usage and simpler integration.
  • Good for development, demos, or foreground-only use cases.
  1. BACKGROUND mode (Android)
  • SDK runs continuously in a foreground service, even when the app is backgrounded.
  • Enables always-on mesh networking and better reachability.
  • Higher battery consumption; best for critical connectivity scenarios.
  1. HYBRID mode (recommended)
  • Runs in the foreground while the app is active.
  • Automatically switches to background mode when the app is backgrounded.
  • Automatically resumes foreground mode when the app becomes active again.
  • Smart balance between connectivity and battery for the best user experience.

Multi-platform support

Bridgefy SDKs interoperate across platforms so iOS and Android devices can communicate seamlessly as long as they run a Bridgefy-enabled app.


Contact & support

For commercial inquiries, technical questions, or integration help, reach out using the channels below.


© 2026 Bridgefy Inc. All rights reserved.