User Setup & Tokens

LAST EDIT Oct 22 2021
These docs are deprecated and will be removed from the site in the near future. Refer to the most up to date version of the iOS UI Component SDK,

Tokens are used to authenticate the user. Typically, you send this token from your backend to the client when a user registers or logs in. You generate tokens on your server.

Basic Setup


You can quickly setup the user with a Token that you already have from our Dashboard and quickly test your chat without thinking about getting a user token from your backend.

Token Provider - Closure (Recommended)


The Token Provider method will call your token service to get a token and finish user setup. You need to setup a callback with a tokenProvider function that you need to call when you get the token.

Expiring Tokens


By default, user tokens are valid indefinitely. Use Token Provider - Closure method to setup a user with an expiring token. Token Provider will call your token service automatically to refresh it when the user token is expired and resume all queued requests with refreshed token.

Development Token


For development applications, it is possible to disable token authentication and use client-side generated tokens.

⚠️ Disabling auth checks is not suitable for a production application and should only be done for proofs-of-concept and applications in the early development stage.

To enable development tokens, you need to change your application configuration in our Dashboard.

Guest Users


Guest sessions can be created client-side and do not require any server-side authentication.

Guest users have a limited set of permissions. You can read more about how to configure permissions here.

Anonymous Users


If a user is not logged in, you can initialize the client with an anonymous token provider. While you’re anonymous, you can’t do much, but for the livestream channel type, you’re still allowed to read the chat conversation.