Adaptors
Adaptors are the platform-specific pieces you pass to ESPRMNeoBase.configure() so the SDK can use storage, provisioning, and MQTT on your runtime. The SDK core does not ship native modules; adaptors bridge that gap.
You do not need to invent these from scratch. ESP RainMaker Home already implements them for React Native. Start from those implementations and the shared interfaces, then wire the same contracts into your app.
Reference implementations
- native-adaptors/interfaces — the contracts
- native-adaptors/implementations — working React Native implementations
Each platform needs its own adaptor implementation. Developers can reuse or adapt the existing Home app adaptors, or implement the same contracts using these interfaces for their target platform.
The three adaptors
| Adaptor | Configuration key | Enables | Home app implementation |
|---|---|---|---|
| Storage | customStorageAdapter | Token, credential and node-config persistence | ESPAsyncStorage |
| Provisioning | provisionAdapter | Adding a device over BLE or SoftAP | ESPProvAdapter |
| MQTT | mqttAdapter | Live updates and cloud parameter writes | ESPMQTTAdapter |
All three live under native-adaptors/implementations.
- Storage — keeps the user signed in. Use a real store on React Native; browsers can use
localStorage. - Provisioning — finds and adds devices over BLE or SoftAP. Skip it if you do not provision devices.
- MQTT — needed for live updates and device control. Pass it in
configure().
Pass only the adaptors your app needs. You can set storage and provisioning later with setStorageAdapter() and setProvisioningAdapter(). MQTT must be set in configure().
Related
- Getting started — where adaptors are passed in
- Configuration reference — adaptor keys and their types
- Provisioning — the flow the provisioning adaptor serves
- Live updates — what the MQTT adaptor powers
- ESP RainMaker Home implementations — reference React Native adaptors