Users
The users class manages users and App access programmatically. Use it to list available Apps, look up specific Apps, view registered users, and generate invitation links to onboard users dynamically. This class provides static functions only and does not require an instance. The code class name is Users.
getApplications
Retrieves a list of all available Apps. Use this function to get an overview or populate selection lists in your UI.
Parameters
None.
Output
Returns an array of App objects, each containing id and the App's data fields such as appName and appId. Throws an error if the request fails.
getApplication
Retrieves details for a specific App.
Parameters
app
The name, short ID, or long ID (UUID) of the App.
string
Output
Returns a single App object, or nothing if not found.
Examples
getUsers
Retrieves a list of all users registered for a specific App.
Parameters
app
The name, short ID, or long ID (UUID) of the App.
string
Output
Returns an array of user objects containing profile and status details. Returns an empty array if the App is not found. lastLogin is a Unix timestamp in milliseconds.
Examples
createAccessLink
Generates a link for a user to access a specific App. The function automatically handles three scenarios:
New user: If the email address does not exist, the function creates the user and generates an invite link.
Existing user without a password: If the user exists but has not set a password, the function generates an invite link prompting them to set one.
Existing active user: If the user exists and has a valid password, the function generates a standard login link.
Use this function to build user invitation features in your Apps.
Parameters
app
The name, short ID, or long ID (UUID) of the target App.
string
email
The email address of the user.
string
Output
Returns an object containing the generated link and user status details. Throws an error if the App is not found.
link: The invite or standard login link to send to the user depending on their scenario.login: The standard login link for the App.userStatus: Returnscreatedif a new user was created, orexistedif they already had an account.registrationStatus: Returnscreatedif the user was newly registered for this App, orexisted.passwordSetupRequired: Returnstrueif the user must set a password using the invite link.
Examples
Last updated
Was this helpful?