Skip to main content

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

GoalGuide
Sign up, sign in (password, OTP, OAuth)Authentication
Forgot / change passwordPasswords
Name, phone, profileUser Profile
Custom JSON, geo, timezoneCustom Data
User tagsTags
MFA, delete accountSecurity
Logout, tokensSessions
FCM / APNS endpointsPush Notifications
MQTT / video AWS credentialsAssume Role

Best Practices

  1. Configure storage adapter before auth — sessions persist via Adapters
  2. Call getLoggedInUser() on startup to restore sessions without forcing login
  3. Register push after login — endpoint is per user and device token
  4. Use assumeRole only when needed — MQTT or camera streaming, not for routine REST calls

On this page