Overview
Sign up, sign in, manage profiles, sessions, security, and push endpoints for RainMaker apps.
备注
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
}