
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
friend-lite-react-native
Advanced tools
A React Native SDK for connecting to and interacting with Omi devices via Bluetooth Low Energy (BLE).
git clone https://github.com/BasedHardware/omi.git
cd sdks/react-native
npm install
cd example
npm install
cd ios
pod install
Note: The pod install step is crucial and must not be skipped for iOS development. Without it, the app will fail to build with native module errors.
cd example/ios
open OmiSDKExample.xcworkspace # Do NOT open the .xcodeproj file
cd example
npm run android
npm install @omiai/omi-react-native
# or
yarn add @omiai/omi-react-native
This SDK relies on react-native-ble-plx for BLE communication.
npm install react-native-ble-plx
# or
yarn add react-native-ble-plx
After installing the dependencies, for iOS projects you MUST run:
cd ios
pod install
For iOS, add the following to your Info.plist:
<key>NSBluetoothAlwaysUsageDescription</key>
<string>This app uses Bluetooth to connect to Omi devices</string>
<key>NSBluetoothPeripheralUsageDescription</key>
<string>This app uses Bluetooth to connect to Omi devices</string>
For Android, add the following permissions to your AndroidManifest.xml:
<uses-permission android:name="android.permission.BLUETOOTH"/>
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<!-- For Android 12+ -->
<uses-permission android:name="android.permission.BLUETOOTH_SCAN" />
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />
import { OmiConnection, DeviceConnectionState, BleAudioCodec } from '@omiai/omi-react-native';
// Create an instance of OmiConnection
const omiConnection = new OmiConnection();
// Scan for devices
const stopScan = omiConnection.scanForDevices((device) => {
console.log('Found device:', device.name, device.id);
}, 10000); // Scan for 10 seconds
// Connect to a device
async function connectToDevice(deviceId) {
const success = await omiConnection.connect(deviceId, (id, state) => {
console.log(`Device ${id} connection state changed to: ${state}`);
});
if (success) {
console.log('Connected successfully!');
// Get the audio codec
const codec = await omiConnection.getAudioCodec();
console.log('Device audio codec:', codec);
// Start listening for audio data
const subscription = await omiConnection.startAudioBytesListener((bytes) => {
console.log('Received audio bytes:', bytes.length);
// Process audio bytes here
});
// Get battery level
const batteryLevel = await omiConnection.getBatteryLevel();
console.log('Battery level:', batteryLevel);
// Later, stop listening for audio
await omiConnection.stopAudioBytesListener(subscription);
// Disconnect when done
await omiConnection.disconnect();
}
}
The main class for interacting with Omi devices.
scanForDevices(onDeviceFound, timeoutMs = 10000)Scans for nearby Omi devices.
onDeviceFound: Callback function that receives an OmiDevice object when a device is foundtimeoutMs: Scan timeout in milliseconds (default: 10000)connect(deviceId, onConnectionStateChanged)Connects to an Omi device.
deviceId: The ID of the device to connect toonConnectionStateChanged: Optional callback for connection state changesdisconnect()Disconnects from the currently connected device.
isConnected()Checks if connected to a device.
getAudioCodec()Gets the audio codec used by the device.
startAudioBytesListener(onAudioBytesReceived)Starts listening for audio bytes from the device.
onAudioBytesReceived: Callback function that receives audio bytes as a number arraystopAudioBytesListener(subscription)Stops listening for audio bytes.
subscription: The subscription returned by startAudioBytesListenergetBatteryLevel()Gets the current battery level from the device.
interface OmiDevice {
id: string;
name: string;
rssi: number;
}
enum DeviceConnectionState {
CONNECTED = 'connected',
DISCONNECTED = 'disconnected'
}
enum BleAudioCodec {
PCM16 = 'pcm16',
PCM8 = 'pcm8',
OPUS = 'opus',
UNKNOWN = 'unknown'
}
Build fails with native module errors on iOS
pod install in the ios directory.xcworkspace file, not the .xcodeproj fileDevice not found during scanning
Connection fails
Audio data not received
Transcription not working
Keyboard overlaps input fields
MIT
FAQs
React Native SDK for certain devices
We found that friend-lite-react-native demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.