Create User

In Amity SDK, creating a new user can be done through the login method. Once the user account has been created, the user can then log into the app using their userId and displayName using the SDK's social and chat features.

You may need to create a new user account via the SDK, such as when integrating the SDK with an existing user authentication system. In these cases, you can use the login method. Here's how the login method works:

  • If a user already exists for the specified userId, the SDK will log the user into the app using the provided userId. The displayName parameter can be updated upon calling the login method. If the displayName parameter is not provided, the system will retain the existing user's displayName.

  • If a user account does not already exist for the specified userId, the SDK will automatically create a new user account with the provided displayName and log the user into the app. If displayName is not provided, the userId will be used as displayName.

Note:

  • When user edits / adds their display name, it can be up to 100 characters in length.

  • When a user ID is created, it can be up to 50 characters in length.

  • If displayName is passed, but secured mode is enabled, the values will be ignored.

Last updated