Commission Adaptor
The Commission Adaptor connects the RainMaker Matter SDK to your app’s native Matter stack. Pairing, BLE/Wi-Fi sessions, and secure key storage stay on the native side; the SDK handles RainMaker cloud calls when the adaptor reports commissioning events.
Required for fabric.startCommissioning() and fabric.issueUserNoC().
Reference implementation: ESPMatterAdapter.ts in esp-rainmaker-home native-adaptors.
What the adaptor does
| Responsibility | Who owns it |
|---|---|
| Scan QR / run Matter pairing session | Native (via adaptor) |
| Store keys and generate CSRs | Native (via adaptor) |
| Issue node NoC and confirm commissioning | SDK (cloud APIs) |
| Send results back to native | SDK → adaptor postMessage |
The Home app adaptor is a thin bridge: start commissioning from native, normalize events for the SDK, and pass SDK responses back to native. Prefer that implementation over writing a new bridge.
Required methods
ESPMatterCommissioningAdaptorInterface requires three methods (already implemented in ESPMatterAdapter.ts):
generateCSR(fabricInfo)
Create a certificate signing request in secure storage (KeyStore / Keychain) for fabric or user certificates.
startEcosystemCommissioning(onboardingPayload, fabric, onEvent)
Start native commissioning with the QR code or onboarding payload. When native reaches key steps, call onEvent with:
NODE_NOC_REQUEST— device CSR and device ID; the SDK callsissueNodeNoCand replies viapostMessage- Commissioning confirmation — RainMaker/Matter node IDs and challenge data; the SDK calls
confirmMatterNodeCommissioningand replies viapostMessage
Return a cleanup function so the app can remove listeners when the commissioning screen closes.
postMessage(payload)
Send SDK responses to native (for example NoC issued, confirmation success or failure). Native uses this to finish the Matter session on the device.
Configure the adaptor
import { ESPRMMatterBase } from "@espressif/rainmaker-matter-sdk";
import { matterCommissioningAdaptor } from "./native-adaptors/implementations/ESPMatterAdapter";
ESPRMMatterBase.configure({
baseUrl: "https://api.rainmaker.espressif.com",
version: "v1",
matterCommissioningAdaptor,
matterVendorId: "0x131B",
// ... base SDK adapters (storage, etc.)
});
How the SDK uses it
When the user starts commissioning:
const cleanup = await fabric.startCommissioning(
"<QR_CODE_OR_ONBOARDING_PAYLOAD>",
(progress) => {
console.log(progress.status, progress.description);
}
);
- SDK calls
startEcosystemCommissioningon the adaptor. - Native runs pairing; adaptor fires
onEventfor NoC and confirm steps. - SDK calls RainMaker APIs and uses
postMessageso native can complete commissioning. - App receives progress via the callback (
ON_PROGRESS,SUCCESS,FAILED).
For step-by-step app integration (React Native, Android, iOS), see Device commissioning and Native Bridge.
Event shapes
Normalize native payloads before calling onEvent:
- NoC request — include
requestData.csr,requestData.deviceId,groupId,fabricId - Confirm request — include
matterNodeId,rainmakerNodeId(for RainMaker Matter devices), and challenge response fields as required by your platform
See Matter Adapters for the full Home app reference table.