Overview
Sign up, sign in, manage profiles, sessions, security, and push endpoints for RainMaker apps.
note
Start with Getting Started to configure ESPRMBase. Most flows use userInstance (ESPRMUser) after sign-in.
What This Module Does ?
User Management covers identity and account operations for RainMaker: authentication, passwords, profile, custom data, tags, MFA, sessions, push registration, and temporary AWS credentials (assumeRole).
Use this when your app needs a signed-in user before Device Management or Group Management.
Expected outcome: A logged-in ESPRMUser you can use for nodes, groups, and cloud-backed features.
Common Workflows
Sign in (password)
const authInstance = ESPRMBase.getAuthInstance();
const userInstance = await authInstance.login(username, password);
See Authentication.
Restore session on app launch
const authInstance = ESPRMBase.getAuthInstance();
const userInstance = await authInstance.getLoggedInUser();
if (!userInstance) {
// Show login screen
}
See Sessions.
Register for push notifications
const endpointArn = await userInstance.createPlatformEndpoint({
platform: "FCM",
deviceToken: fcmToken,
});
See Push Notifications. Configure FCM/APNS in the push setup guide first.
Developer journey
| Goal | Guide |
|---|---|
| Sign up, sign in (password, OTP, OAuth) | Authentication |
| Forgot / change password | Passwords |
| Name, phone, profile | User Profile |
| Custom JSON, geo, timezone | Custom Data |
| User tags | Tags |
| MFA, delete account | Security |
| Logout, tokens | Sessions |
| FCM / APNS endpoints | Push Notifications |
| MQTT / video AWS credentials | Assume Role |
Best Practices
- Configure storage adapter before auth — sessions persist via Adapters
- Call
getLoggedInUser()on startup to restore sessions without forcing login - Register push after login — endpoint is per user and device token
- Use
assumeRoleonly when needed — MQTT or camera streaming, not for routine REST calls