Overview
Organize RainMaker nodes into groups, manage membership, share access.
The userInstance refers to ESPRMUser from User Sign in.
What This Module Does ?
Groups (ESPRMGroup) let you bundle nodes for homes, rooms, create and update groups, add/remove nodes, share with other users
Use this when your app organizes devices beyond a flat node list (rooms, homes, shared access for family members).
Use Device Management for provisioning and per-node control. You can add a node to a group during provisioning via optional groupId.
Expected outcome: Groups appear in getGroups(), nodes can be managed per group, and sharing requests can be sent or accepted.
Common Workflows
List groups
const response = await userInstance.getGroups({
resultCount: 10,
withNodeList: true,
withSubGroups: true,
});
See Get Groups.
Create a group and add nodes
const group = await userInstance.createGroup({
name: "Living Room Devices",
nodeIds: ["node_id_1", "node_id_2"],
description: "All devices in the living room",
});
See Manage Groups.
Share a group
await userInstance.shareGroups({
username: "family@example.com",
groupIds: [group.id],
});
See Share Groups.
Update group metadata
await group.updateMetadata({ room: "living_room", floor: 1 });
See Group Metadata.
Developer journey
| Goal | Guide |
|---|---|
| List or find groups | Get Groups |
| Create, update, delete, nodes, subgroups | Manage Groups |
| Share, transfer, sharing requests | Share Groups |
| Custom metadata | Group Metadata |
Best Practices
- Fetch groups with
withNodeListwhen building room dashboards - Use subgroups for large homes — parent = floor, child = room
- Handle sharing requests in UI — sent and received lists
- Provision into a group when you know the target group at onboarding time
Related Resource
For complete API details including method signatures, parameters, return types, interfaces, and type definitions, refer to:
- API Reference:
- ESPRMUser —
getGroups(),createGroup(),shareGroups(), sharing requests - ESPRMGroup —
addNodes(),updateGroupInfo(),share(),updateMetadata()
- ESPRMUser —