Users class
The Users service allows you to manage your project users.
Properties
Methods
-
create(
{required String userId, String? email, String? phone, String? password, String? name}) → Future< User> - Create a new user.
-
createArgon2User(
{required String userId, required String email, required String password, String? name}) → Future< User> - Create a new user. Password provided must be hashed with the Argon2 algorithm. Use the POST /users endpoint to create users with a plain text password.
-
createBcryptUser(
{required String userId, required String email, required String password, String? name}) → Future< User> - Create a new user. Password provided must be hashed with the Bcrypt algorithm. Use the POST /users endpoint to create users with a plain text password.
-
createJWT(
{required String userId, String? sessionId, int? duration}) → Future< Jwt> - Use this endpoint to create a JSON Web Token for user by its unique ID. You can use the resulting JWT to authenticate on behalf of the user. The JWT secret will become invalid if the session it uses gets deleted.
-
createMD5User(
{required String userId, required String email, required String password, String? name}) → Future< User> - Create a new user. Password provided must be hashed with the MD5 algorithm. Use the POST /users endpoint to create users with a plain text password.
-
createMFARecoveryCodes(
{required String userId}) → Future< MfaRecoveryCodes> - Generate recovery codes used as backup for MFA flow for User ID. Recovery codes can be used as a MFA verification type in createMfaChallenge method by client SDK.
-
createMfaRecoveryCodes(
{required String userId}) → Future< MfaRecoveryCodes> - Generate recovery codes used as backup for MFA flow for User ID. Recovery codes can be used as a MFA verification type in createMfaChallenge method by client SDK.
-
createPHPassUser(
{required String userId, required String email, required String password, String? name}) → Future< User> - Create a new user. Password provided must be hashed with the PHPass algorithm. Use the POST /users endpoint to create users with a plain text password.
-
createScryptModifiedUser(
{required String userId, required String email, required String password, required String passwordSalt, required String passwordSaltSeparator, required String passwordSignerKey, String? name}) → Future< User> - Create a new user. Password provided must be hashed with the Scrypt Modified algorithm. Use the POST /users endpoint to create users with a plain text password.
-
createScryptUser(
{required String userId, required String email, required String password, required String passwordSalt, required int passwordCpu, required int passwordMemory, required int passwordParallel, required int passwordLength, String? name}) → Future< User> - Create a new user. Password provided must be hashed with the Scrypt algorithm. Use the POST /users endpoint to create users with a plain text password.
-
createSession(
{required String userId}) → Future< Session> - Creates a session for a user. Returns an immediately usable session object.
-
createSHAUser(
{required String userId, required String email, required String password, PasswordHash? passwordVersion, String? name}) → Future< User> - Create a new user. Password provided must be hashed with the SHA algorithm. Use the POST /users endpoint to create users with a plain text password.
-
createTarget(
{required String userId, required String targetId, required MessagingProviderType providerType, required String identifier, String? providerId, String? name}) → Future< Target> - Create a messaging target.
-
createToken(
{required String userId, int? length, int? expire}) → Future< Token> - Returns a token with a secret key for creating a session. Use the user ID and secret and submit a request to the PUT /account/sessions/token endpoint to complete the login process.
-
delete(
{required String userId}) → Future - Delete a user by its unique ID, thereby releasing it's ID. Since ID is released and can be reused, all user-related resources like documents or storage files should be deleted before user deletion. If you want to keep ID reserved, use the updateStatus endpoint instead.
-
deleteIdentity(
{required String identityId}) → Future - Delete an identity by its unique ID.
-
deleteMFAAuthenticator(
{required String userId, required AuthenticatorType type}) → Future - Delete an authenticator app.
-
deleteMfaAuthenticator(
{required String userId, required AuthenticatorType type}) → Future - Delete an authenticator app.
-
deleteSession(
{required String userId, required String sessionId}) → Future - Delete a user sessions by its unique ID.
-
deleteSessions(
{required String userId}) → Future - Delete all user's sessions by using the user's unique ID.
-
deleteTarget(
{required String userId, required String targetId}) → Future - Delete a messaging target.
-
get(
{required String userId}) → Future< User> - Get a user by its unique ID.
-
getMFAChallenge(
{required String userId, required String challengeId}) → Future< MfaChallengeSecret> - Get a custom MFA challenge for a user, including the code to be delivered through your own channel.
-
getMFARecoveryCodes(
{required String userId}) → Future< MfaRecoveryCodes> - Get recovery codes that can be used as backup for MFA flow by User ID. Before getting codes, they must be generated using createMfaRecoveryCodes method.
-
getMfaRecoveryCodes(
{required String userId}) → Future< MfaRecoveryCodes> - Get recovery codes that can be used as backup for MFA flow by User ID. Before getting codes, they must be generated using createMfaRecoveryCodes method.
-
getPrefs(
{required String userId}) → Future< Preferences> - Get the user preferences by its unique ID.
-
getTarget(
{required String userId, required String targetId}) → Future< Target> - Get a user's push notification target by ID.
-
list(
{List< String> ? queries, String? search, bool? total}) → Future<UserList> - Get a list of all the project's users. You can use the query params to filter your results.
-
listIdentities(
{List< String> ? queries, String? search, bool? total}) → Future<IdentityList> - Get identities for all users.
-
listLogs(
{required String userId, List< String> ? queries, bool? total}) → Future<LogList> - Get the user activity logs list by its unique ID.
-
listMemberships(
{required String userId, List< String> ? queries, String? search, bool? total}) → Future<MembershipList> - Get the user membership list by its unique ID.
-
listMFAFactors(
{required String userId}) → Future< MfaFactors> - List the factors available on the account to be used as a MFA challange.
-
listMfaFactors(
{required String userId}) → Future< MfaFactors> - List the factors available on the account to be used as a MFA challange.
-
listSessions(
{required String userId, bool? total}) → Future< SessionList> - Get the user sessions list by its unique ID.
-
listTargets(
{required String userId, List< String> ? queries, bool? total}) → Future<TargetList> - List the messaging targets that are associated with a user.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
updateEmail(
{required String userId, required String email}) → Future< User> - Update the user email by its unique ID.
-
updateEmailVerification(
{required String userId, required bool emailVerification}) → Future< User> - Update the user email verification status by its unique ID.
-
updateImpersonator(
{required String userId, required bool impersonator}) → Future< User> - Enable or disable whether a user can impersonate other users. When impersonation headers are used, the request runs as the target user for API behavior, while internal audit logs still attribute the action to the original impersonator and store the impersonated target details only in internal audit payload data.
-
updateLabels(
{required String userId, required List< String> labels}) → Future<User> - Update the user labels by its unique ID.
-
updateMFA(
{required String userId, required bool mfa}) → Future< User> - Enable or disable MFA on a user account.
-
updateMfa(
{required String userId, required bool mfa}) → Future< User> - Enable or disable MFA on a user account.
-
updateMFARecoveryCodes(
{required String userId}) → Future< MfaRecoveryCodes> - Regenerate recovery codes that can be used as backup for MFA flow by User ID. Before regenerating codes, they must be first generated using createMfaRecoveryCodes method.
-
updateMfaRecoveryCodes(
{required String userId}) → Future< MfaRecoveryCodes> - Regenerate recovery codes that can be used as backup for MFA flow by User ID. Before regenerating codes, they must be first generated using createMfaRecoveryCodes method.
-
updateName(
{required String userId, required String name}) → Future< User> - Update the user name by its unique ID.
-
updatePassword(
{required String userId, required String password}) → Future< User> - Update the user password by its unique ID.
-
updatePhone(
{required String userId, required String number}) → Future< User> - Update the user phone by its unique ID.
-
updatePhoneVerification(
{required String userId, required bool phoneVerification}) → Future< User> - Update the user phone verification status by its unique ID.
-
updatePrefs(
{required String userId, required Map prefs}) → Future< Preferences> - Update the user preferences by its unique ID. The object you pass is stored as is, and replaces any previous value. The maximum allowed prefs size is 64kB and throws error if exceeded.
-
updateStatus(
{required String userId, required bool status}) → Future< User> - Update the user status by its unique ID. Use this endpoint as an alternative to deleting a user if you want to keep user's ID reserved.
-
updateTarget(
{required String userId, required String targetId, String? identifier, String? providerId, String? name}) → Future< Target> - Update a messaging target.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited