import { Users } from "https://deno.land/x/appwrite@12.1.0/mod.ts";
Constructors
Methods
Create user
Create a new user.
Create user with Argon2 password
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.
Create user with bcrypt password
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.
Create user 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.
Create user with MD5 password
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.
Create MFA Recovery Codes
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.
Create user with PHPass password
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.
Create user with Scrypt modified password
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.
Create user with Scrypt password
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.
Create session
Creates a session for a user. Returns an immediately usable session object.
If you want to generate a token for a custom authentication flow, use the POST /users/{userId}/tokens endpoint.
Create user with SHA password
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.
Create User Target
Create a messaging target.
Create 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 user
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.
Delete identity
Delete an identity by its unique ID.
Delete Authenticator
Delete an authenticator app.
Delete user session
Delete a user sessions by its unique ID.
Delete user sessions
Delete all user's sessions by using the user's unique ID.
Delete user target
Delete a messaging target.
Get user
Get a user by its unique ID.
Get MFA Recovery Codes
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.
Get user preferences
Get the user preferences by its unique ID.
Get User Target
Get a user's push notification target by ID.
List users
Get a list of all the project's users. You can use the query params to filter your results.
List Identities
Get identities for all users.
List user logs
Get the user activity logs list by its unique ID.
List user memberships
Get the user membership list by its unique ID.
List Factors
List the factors available on the account to be used as a MFA challange.
List user sessions
Get the user sessions list by its unique ID.
List User Targets
List the messaging targets that are associated with a user.
Update email
Update the user email by its unique ID.
Update email verification
Update the user email verification status by its unique ID.
Update user labels
Update the user labels by its unique ID.
Labels can be used to grant access to resources. While teams are a way for user's to share access to a resource, labels can be defined by the developer to grant access without an invitation. See the Permissions docs for more info.
Update MFA
Enable or disable MFA on a user account.
Regenerate MFA Recovery Codes
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.
Update name
Update the user name by its unique ID.
Update password
Update the user password by its unique ID.
Update phone
Update the user phone by its unique ID.
Update phone verification
Update the user phone verification status by its unique ID.
Update user 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.
Update user status
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.
Update User target
Update a messaging target.