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

react-native-sdk-ble-middleware-v3

v0.0.3

Published

A React Native middleware library for simplified BLE (Bluetooth Low Energy) operations with context-based API

Readme

react-native-middleware

A React Native middleware library that provides a simplified, context-based API for BLE (Bluetooth Low Energy) operations. This middleware wraps react-native-sdk-ble-v3 and handles all the complexity of BLE communication, so your demo app only needs to install this middleware.

✨ Features

  • 🔌 Simplified BLE Operations - Easy-to-use API for scanning, connecting, and managing BLE devices
  • 📡 Automatic Event Handling - Built-in state management for devices, connections, and notifications
  • 🎣 React Hooks - Custom hooks for seamless integration with React components
  • 🔔 Notification Support - Automatic handling of characteristic notifications (FF21, FF31, FF41, FF02)
  • Infusion Control - Built-in methods for controlling infusion devices (start/stop commands)
  • �🛡️ Type-Safe - Full TypeScript support with comprehensive type definitions
  • 📱 Cross-Platform - Works on both Android and iOS

📦 Installation

In Your Demo App

Step 1: Install the middleware package

npm install react-native-middleware

or

yarn add react-native-middleware

Step 2: Install the required peer dependency

npm install react-native-sdk-ble-v3

or

yarn add react-native-sdk-ble-v3

Step 3: Link native dependencies (if not using auto-linking)

npx pod-install  # iOS only

Note: react-native-sdk-ble-v3 is a peer dependency. You need to install it in your demo app so that the native modules are properly linked to your app's binary.

In the Middleware Package (For Development)

cd react-native-middleware
npm install
npm run prepare

🚀 Quick Start

1. Wrap Your App with BLEProvider

import { BLEProvider } from 'react-native-middleware';

export default function App() {
  return (
    <BLEProvider>
      <YourApp />
    </BLEProvider>
  );
}

2. Use BLE Hooks in Your Components

import { useBLE } from 'react-native-middleware';

function DeviceScanner() {
  const {
    bluetoothEnabled,
    isScanning,
    discoveredDevices,
    connectedDeviceId,
    startScan,
    stopScan,
    connectToDevice,
  } = useBLE();

  return (
    <View>
      <Button
        title={isScanning ? 'Stop Scan' : 'Start Scan'}
        onPress={isScanning ? stopScan : startScan}
      />

      {discoveredDevices.map((device) => (
        <TouchableOpacity
          key={device.id}
          onPress={() => connectToDevice(device)}
        >
          <Text>{device.name || 'Unknown Device'}</Text>
        </TouchableOpacity>
      ))}
    </View>
  );
}

📚 Documentation

🎯 Architecture

┌─────────────────┐
│   Demo App      │  ← Only installs react-native-middleware
│                 │
└────────┬────────┘
         │ Uses
         ▼
┌─────────────────┐
│   Middleware    │  ← Provides BLEProvider, hooks, and utilities
│                 │
└────────┬────────┘
         │ Wraps
         ▼
┌─────────────────┐
│ react-native-   │  ← Only installed in middleware package
│   sdk-ble       │
└─────────────────┘

🔧 Available Hooks

useBLE()

Complete BLE functionality with all state and operations, including infusion control.

useBLEDevices()

Device scanning and discovery functionality.

useBLEConnection()

Connection status and disconnect operation.

useBLENotifications()

Access to characteristic notifications.

useBLEInfusion()

Infusion control operations (enableBluetooth, startInfusion, stopInfusion).

📱 Supported Platforms

  • ✅ iOS 13.0+
  • ✅ Android SDK 21+

🛠️ Requirements

  • React Native >= 0.70
  • React >= 18.0

📄 License

MIT

🤝 Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

🐛 Issues

If you find a bug or have a feature request, please open an issue on GitHub.


Made with create-react-native-library