Skip to main content

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

In ESP RainMaker Home:

Platform-specific implementation

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

AdaptorConfiguration keyEnablesHome app implementation
StoragecustomStorageAdapterToken, credential and node-config persistenceESPAsyncStorage
ProvisioningprovisionAdapterAdding a device over BLE or SoftAPESPProvAdapter
MQTTmqttAdapterLive updates and cloud parameter writesESPMQTTAdapter

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().