Skip to main content

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 toRead
Register or sign inAuthentication
Recover or change a passwordPasswords
Understand tokens and credentialsSessions and credentials
Read the user's identityUser info
Receive push notificationsIntegrations
Observe discovery or node updatesEvents

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();
There is no OTP or third-party sign-in

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.