Docs Menu
Docs Home
/ /
Atlas Device SDKs
/ /

Create and Delete a User - Web SDK

On this page

  • Create a User
  • Delete a User

For most authentication methods, Atlas App Services automatically creates a user account the first time a user authenticates. The only exception is email/password authentication. When you use email/password authentication, you must register and confirm a user before the user can authenticate to an App.

New in version 1.7.0.

Call the App.deleteUser() on a user object to delete the user's account from your Realm application. This deletes the account from the server in addition to clearing local data.

await app.deleteUser(app.currentUser);

To use your app in the future, the user must sign up for a new account. They can use the same credentials (depending on the authentication provider), but will not have the same User ID as their deleted account.

Important

Deleting All User Data

Deleting a user only deletes the user object, which may contain associated metadata from the associated auth provider. This does not delete custom user data or other user data that your app stores in a linked collection or external services.

Use the Authentication Trigger DELETE event to programmatically clean up other data when you delete a user. For example, you can delete the user's data from your custom user data collection or another service.

Back

User Management