Comment on page
User
Amity SDK's do not store or manage any user data. This means that you do not have to import or migrate existing user profiles into the system, user management should be handled by your application code. Instead, every user is simply represented by a unique
userID
, which can be any string that uniquely identifies the user and is immutable throughout its lifetime.A database primary key would make an idealuserID
. Conversely, something like username or emails is not recommended as those values may change over time.
If you wish to assign additional permissions for a user, for example, moderation privileges or different sending limits, you can provide an array of roles to assign to this user. Roles are defined in the admin panel and can be tied to an unlimited number of users. Once again, Amity does not store or manage any user data, which means you do not have to import or migrate existing users into the system. It also means that Amity cannot provide user management functionalities like list of users, or limit actions of certain users (e.g. user permissions). Instead, these functionalities should be handled by the rest of your application's capabilities and your server.
Name | Data Type | Description | Attributes |
userId | string | The id of this user | |
roles | Array.<string> | A list of user's roles | |
displayName | string | The display name of the user | |
flagCount | integer | The number of users that have flagged this user | |
metadata | Object | The metadata of the user | |
hashFlag | Object | A hash for checking internally if this user was flagged by the user | |
createdAt | date | The date/time the user was created at | |
updatedAt | date | The date/time the user was updated at | |
isGlobalBan | Boolean | Flag that indicates if the user is globally banned. True means the user is globally banned.
Note: This is not yet supported for Typescript | |
avatarCustomUrl | String | Custom Url provided for this user avatar | |
isDeleted | Boolean | Flag that indicates if the user is deleted | |
Though the SDK does not store and should not be responsible for the handling User profile data for your application; We do provide tools to make some surface-level queries and searches for existing user accounts. With the help of our
UserRepository
class, you will be able to list all the users, search for list of users whose display name matches your search query and get AmityUser
object from user ID.iOS
Android
JavaScript
Flutter
import { UserRepository } from '@amityco/js-sdk';
const userRepo = new UserRepository();
You can ban a user globally. When users are globally banned, they can no longer access Amity's network and will be forcibly removed from all their existing channels.
Last modified 24d ago