Guides
Setup Runtime
Install and initialize BLEMeshJS so your app can scan and connect.
Use this page when you are wiring BLEMeshJS into an app for the first time.
1. Install the runtime package
yarn add @blemeshjs/sdk-webyarn add @blemeshjs/sdk-react-native \
@react-native-async-storage/async-storage \
react-native-ble-plx \
react-native-get-random-valuesyarn add @blemeshjs/sdk2. Create the mesh manager
import { MeshNetworkManager, createMesh } from "@blemeshjs/sdk-web";
const mesh = await createMesh({
meshNetworkManager: MeshNetworkManager.instance,
});import { MeshNetworkManager, createMesh } from "@blemeshjs/sdk-react-native";
const mesh = await createMesh({
meshNetworkManager: MeshNetworkManager.instance,
});import { MeshNetworkManager } from "@blemeshjs/sdk";
const mesh = MeshNetworkManager.instance;
mesh.init(myCentralManager, myStorage);
await mesh.setup();This configures the shared manager with transport and storage for your runtime.
3. Create a network if this is a fresh install
if (!mesh.isNetworkCreated) {
await mesh.createNewMeshNetwork();
}4. Verify BLE readiness before scanning
mesh.connection.on("ble:state-change", (state) => {
console.log("BLE state:", state);
});✅ Best practice
Create and initialize the mesh manager once at app startup, then reuse it instead of recreating it in each screen or route.
⚠️ Gotcha
On web, scan UX is browser-mediated due Web Bluetooth limitations. You should expect chooser UI behavior, not a silent background scanner.
At this point, you should have a configured mesh instance that is ready to scan.
Next, you will want to Provision a New Device or Control Device.