Initializes the ESPRMNeoUser instance and persists the tokens to storage.
Object containing the access token, id token, and refresh token.
Registered event subscriber callbacks, keyed by event (see subscribe).
Per-event teardown handles for backing sources started by subscribe (LAN discovery, node-updates bus, custom discovery). Kept so unsubscribe / removeAllCallbacks can stop them.
Exchanges identity (temporary) credentials for role-based credentials.
Two modes — chosen by whether options.services is set:
options.services): POST /v1/assumed-roles. Returns
IoT/MQTT credentials scoped to the user's group/subgroup membership.
Used for MQTT WebSocket auth.options.services with nodeId):
Same route, with services and node_id in the body. Returns
credentials scoped to that single node for the listed services
(currently s3 and/or kvs). The response contains only the
requested service permissions — no IoT/MQTT statements.AWS access key from getTemporaryAWSCredentials.
AWS secret key from getTemporaryAWSCredentials.
AWS session token from getTemporaryAWSCredentials.
Optionaloptions: AssumeRoleOptionsOptional. To request per-node service credentials, pass
services and nodeId.
A promise that resolves to AWSCredentials.
Connects to MQTT websocket.
Client ID format: user:<email|phone>:<session> — required by the
assume-role IoT policy which scopes iot:Connect to that prefix.
A promise that resolves to true if connection was successful.
Creates an ESP device with the given parameters.
The name of the device.
The transport type to use.
Optionalsecurity: ESPSecurityThe security type to use (optional).
OptionalproofOfPossession: stringThe proof of possession string (optional).
OptionalsoftAPPassword: stringThe SoftAP password (optional).
Optionalusername: stringThe username (optional).
A promise that resolves to an ESPDevice instance.
Creates a new group.
Calls POST /v1/groups.
Name of the group
A promise that resolves to the created ESPRMNeoGroup
Retrieves the list of groups associated with the user.
Calls GET /v1/groups.
A promise that resolves to an array of ESPRMNeoGroup instances
Gets temporary AWS credentials for the authenticated user.
Calls POST /v1/user/credentials with the Cognito ID token as Bearer auth.
Refreshes the session (refresh token → new tokens) when the ID token is
expired locally, or when the API returns 401 with an expired-token
message, then retries. Delegates to fetchTemporaryAWSCredentials.
Temporary AWS credentials (access key, secret key, session token, expiration).
Retrieves user information from GET /v1/users/me.
A promise that resolves to an ESPRMNeoUserInfo object containing the user information.
Lists the configured integrations available to the calling user
(SigV4-signed GET /v1/integrations). This is the non-admin counterpart
of the admin listing and exposes only integration_id / integration_type
— no credentials or other configuration.
Use the returned integration_id when registering a delivery endpoint via
ESPRMNeoUser.registerIntegrationEndpoint.
A promise that resolves to the list of configured integrations.
Retrieves sharing requests received by the current user.
Calls GET /v1/sharing-requests/received.
A promise that resolves to an array of ESPRMNeoSharingRequest instances
Logs out the user by invalidating the server session (best-effort), disconnecting MQTT, clearing tokens/credentials, and resetting local state.
A promise that resolves to true if local cleanup completed,
false if an unexpected error occurred.
Registers a delivery endpoint for the calling user on the given integration
(SigV4-signed PUT /v1/integrations/{integrationId}/endpoints). The server
derives an endpoint_id per integration type and returns it.
Callers must persist the returned endpoint_id to later address the endpoint
(e.g. for ESPRMNeoUser.unregisterIntegrationEndpoint).
Target integration id (from ESPRMNeoUser.listIntegrations).
Delivery credential (delivery_credentials.app_token), e.g. the push token.
Optionallocale: stringOptional locale (e.g. en_US).
The endpoint_id derived and returned by the server.
Clears one event, or every event when event is omitted.
Optionalevent: stringSearches for ESP devices with the given prefix.
The prefix of the device name to search for.
The transport type (BLE or SoftAP).
A promise that resolves to an array of ESPDevice instances.
Subscribes a callback to an event (replaces any existing one).
discoveryConfig: starts discovery with that
config and forwards raw results unchanged.OptionaldiscoveryConfig: DiscoveryParamsInterfaceInvokes the registered callback for event (if any) with arg.
Unregisters one specific delivery endpoint for the calling user on the given
integration (SigV4-signed DELETE
/v1/integrations/{integrationId}/endpoints/{endpointId}), cleaning up the
underlying delivery registration.
Integration the endpoint was registered on.
The endpoint_id returned by ESPRMNeoUser.registerIntegrationEndpoint.
API success payload (optional { message } on success).
Removes the callback and stops any backing source for the event.
StaticextendExtends the current session using a refresh token.
Represents an authenticated user in the ESP Rainmaker Neo system. Provides methods for user operations, device management, group management, and MQTT-based real-time communication.