Table of Contents

Understanding users in Sendbird Chat

Understanding users in Sendbird Chat

Jason Allshorn
Solutions Engineer
Tutorial Type: Basic Tutorials Reading Time: 5 mins Building Time: 15 mins
ChatAndroidiOSJSSDK

Introduction

This guide shows how to get started with core Sendbird developer concepts, including how to create, update, and delete users. These activities are fundamental to Sendbird integration, and a good stepping stone to comprehensive Sendbird development mastery.

We’ll cover how to:

  • Work with the Sendbird SDK and user objects to create, review, update, and delete users 

Let’s get started!

At the center of the Sendbird experience are users — entities that connect to Sendbird Chat or Calls via Sendbird’s client-side SDK. A few important things to know about creating users:

  • Sendbird application users can be created manually when you first begin development
  • Users are recommended to be created via the Platform API.
  • User Dashboard operations can be performed programmatically via the Platform API
  • User metadata can be added to the User object via the Platform API only
  • Users connect to the Sendbird application using a Sendbird SDK

With these tips in mind, here’s a little bit more about the Sendbird SDK and user objects.

SDK and user objects

When starting on Sendbird development, users can be logged in without authentication. In production, best practice is to use authentication (access/session tokens).

User Access permissions are controlled via Sendbird Dashboard > Settings > Security

From the SDK, by default, a user can update:

  • nickname (often used for user’s display name)
  • profile _url (image URL)
  • discover_keys (used in Sendbird’s friends discovery feature)
  • metadata (often used to categorize users into groups)
  • preferred_languages

Sendbird also offers the ability to restrict the above preferences to only allow updates to come from the Platform API.

Ready to create users? Keep reading.

How to create users

Dashboard

  • Click “Create user +”
  • ID requires a unique identifier — common for it to be the same user ID used by the client-side application that runs the Sendbird SDK
  • Nickname is required, but editable via Dashboard, Platform API and by the user in the SDK (on request, SDK editing can be turned off)
  • Profile URL is optional, and by default an empty string (profile URLs can be protected by Sendbird’s domain filtering, but not image moderation)
  • Issue access token is optional, but strongly recommended for production use. 

 

Platform API

Create users by Platform API call (how to)

SDK

  • If the security settings of the application are set to “read and write,” a user can be created via SDK (not recommended for production)
  • Connect to Sendbird and pass in any user_id and nickname, and a new user will automatically be created, or an existing user returned
Pro Tip!

When starting out, create 10 users manually in the dashboard, using sequential IDs. User nicknames should be identical to User IDs.

Review users


Users Table

Users are listed in order of newest to oldest created. Click on any User ID to drill down for more details.

User Search

You can also search for users using the User ID, User Nickname or Nickname startswith. 

 

Pro Tip!

By default, a list of all users in an application can be fetched 100 at a time via SDK. It’s also possible to categorize the users via their metadata, then fetch categorized users with a metadata filter. However, this default action can be turned off if your security policy prohibits users from being able to fetch all other users. 

 

Update users


Dashboard

Select user’s ID in order to view and update a user’s profile.

 

SDK

A user can update only their profile image and nickname via Sendbird’s SDKs.

Platform API

All aspects of a user object (profile) can be updated via Platform API including:

  • Nickname
  • Profile URL
  • Metadata
  • Access token
  • Session token

Delete users


Dashboard

It’s possible to delete users one by one or many at a time via the Dashboard. Once a user is deleted, the same user ID can be used to create another user. 

SDK

Sendbird’s SDKs do not provide a “delete user” option.

Platform API

Deleting users one by one via Platform API is also possible.

Hopefully, this tutorial has given you a solid grounding in how to create and work with users via the Sendbird SDK. These basics should create a great foundation for your development efforts. 

Thanks for using Sendbird to create great chat and messaging applications and helping to better connect people.