Skip to main content
Use the user repository when your app needs to find people by display name or browse a paginated user list. Search is for keyword-driven flows such as member pickers, while query is for directory-style lists where sorting and pagination matter more than a search keyword.
Deleted users are automatically excluded from search and query results.

Parameters

This page covers two user-list operations. Choose the operation first, then use the inputs table in each section for the exact SDK call shape.

Search users by display name

Use search when the user types a display-name keyword. Search keywords must be at least 3 characters long. When a keyword is provided, the server ranks matching results by search relevance; supported sort options can then control the returned order.

Selecting which fields to match (searchBy)

By default the keyword is matched against all searchable user fields (display name, user id, and profile handle), so a keyword can surface users that match only by their user id. Provide searchBy to restrict which fields are matched — for example, display name only — so results exclude user-id-only matches.
  • Omitting searchBy (or passing an empty value) keeps the default behavior, so existing integrations are unaffected.
  • Supported field options: displayName, userId, profileHandle.
TypeScript types searchBy as an array of SearchUsersByEnum values, exported from the package root. Plain string literals do not type-check.
Platform support for searchBy differs. iOS, Android, and TypeScript expose it on user search; Flutter support is not yet available.

Inputs

TypeScript UserRepository.searchUserByDisplayName(params, callback) is deprecated in favour of searchUsers(params, callback). Both accept the same parameters and return the same live collection, so switching is a rename. The deprecated method will be removed in a future major version.
TypeScript search parameters intentionally do not include sortBy; use getUsers(...) when you need TypeScript user-list sorting.

Special character handling

With display-name sorting, users are sorted alphabetically by their display names using ICU collation for the English locale. This means that special characters such as Ä are treated as variants of A. For example, a sorted list might appear as: adam, Älex, Alice, Arthur, charlie, Kristen.When providing a search keyword, the API performs an exact-match lookup for special characters:
  • Searching for “Äli” only returns users whose display name contains “Äli”, such as “Älise”.
  • Searching for “Alice” does not return “Älice”.
Use the platform search method to retrieve users whose display name matches the search keyword.

Query users

Use getUsers() when you need a paginated user list without a display-name keyword. TypeScript query sorting supports firstCreated and lastCreated; iOS, Android, and Flutter also expose display-name sorting.

Inputs

Deleted users are excluded from query results.
Use the platform query method when you need a paginated user list rather than keyword search.

Platform notes

  • searchBy (where supported) restricts which fields the keyword matches; omit it to keep the default behavior of matching all searchable fields (display name, user id, profile handle). Flutter does not yet expose searchBy.
  • TypeScript searchUsers(...) starts a live collection observer, but its search params do not expose sortBy. searchUserByDisplayName(...) is a deprecated alias with the same behaviour.
  • iOS search and query methods require an AmityUserSortOption.
  • Android and Flutter default user search/query sorting to display name when no explicit sort is provided.
  • Android takes searchBy as a list — searchBy(listOf(AmitySearchUserBy.DISPLAY_NAME)). Import the enum from com.amity.socialcloud.sdk.model.core.search.AmitySearchUserBy; it lives in a different package from AmityUserSortOption and AmityUserSearchMatchType (com.amity.socialcloud.sdk.api.core.user.search).
  • Use pagination controls from the callback, live collection, PagingData, or Flutter PagingController instead of loading all users at once.

Get User Information

Retrieve one user, batch lookup users where supported, or query user collections.

Update User Information

Modify user profile fields.