User management overview
User management covers identity in the SDK: registering an account, signing in, recovering a password, and everything the resulting session carries; tokens, AWS credentials, push endpoints and process-wide events. It is the first thing an app does, because every other section needs a signed-in ESPRMNeoUser.
Two classes divide the work. ESPRMNeoAuth handles anything you do before you have a user, plus password changes. ESPRMNeoUser is the signed-in user itself, and everything else hangs off it.
The shortest path to a user
import { ESPRMNeoBase } from "@espressif/rainmaker-neo-base-sdk";
const auth = ESPRMNeoBase.getAuthInstance();
const user = await auth.login("<email>", "<password>");
Signing in persists the session through your storage adaptor, so on the next launch you restore it rather than asking again:
const user = await auth.getLoggedInUser();
if (!user) {
// no stored session: show the login screen
}
Both require a configured SDK. See Getting started.
What lives where
| You want to | Read |
|---|---|
| Register or sign in | Authentication |
| Recover or change a password | Passwords |
| Understand tokens and credentials | Sessions and credentials |
| Read the user's identity | User info |
| Receive push notifications | Integrations |
| Observe discovery or node updates | Events |
What the user object gives you
Beyond identity, ESPRMNeoUser is the entry point to the rest of the SDK: getGroups() and createGroup() reach Group management, while createESPDevice() and searchESPDevices() start Device management.
It also owns the MQTT connection. connectMQTT() runs the whole credential chain itself, so live updates need one call rather than three:
await user.connectMQTT();
Password sign-in is the only interactive flow this SDK exposes, and there is no profile-update, custom-data or tag API on the user. Do not carry those call sites over from other Espressif SDKs. See Authentication.
Related
- Authentication — sign-up, sign-in, session restore
- Sessions and credentials — what a session holds
- Getting started — configuring the SDK first
- Device management — what a signed-in user unlocks
- Getting started with the API — the auth chain underneath