Skip to content

Customize user details

kristiyan-petrov edited this page Nov 22, 2023 · 4 revisions

User details provider

Since Kaleyra Video solution treats users of a company referring to them only via anonymous identifiers, in order to display users details on sdk integrations (chat widget, Android and iOS SDks) a set of client-side APIs named as User Details Providers is available.

A user alias is a unique identifier used to map your users in the Kaleyra Video ecosystem. Those identifiers cannot describe your users properly so if you would like to display in-chat or in-call users adequately you must provide details for user alias with UserDetailsProvider interface shown below.

KaleyraVideo.userDetailsProvider = { userIds: List<String> ->
	Result.success(userIds.map {
		UserDetails(
			userId = it,
			name = "displayName",
			image = Uri.parse("https://example.com/avatar.png")
		)
	})
}

Server Side User Details Provider

Since every client had to provide a User Details Provider implementation in order to obtain user display name and image customization on the client call and chat UIs, has now been released a new convenient and centralized way to achieve the same result.

We refer to this function as Server Side User Details Provider.

In order to enable this functionality you must specify a valid user_details_provider_url through the company update rest API.

The provider url, if defined, will be used as an endpoint to request the details of the users through an http post request whenever a client needs to display some user details.

As mentioned above, the best use case scenario for the Server Side User Details Provider implementation is represented by those integrations that relay on an heterogeneous usage of client sdks (e.g. mobile sdks alongside chat widget implementation). Using the Server Side User Details Provider will result in a more concise (and less error prone too) way to display users information. Furthermore it not will be necessary to implement the User Details Provider APIs for the client SDKs.

Despite what has been mentioned, the User Details Provider will be maintained for those integrations that cannot relay on webhook implementations.

More details about the REST integration of the Server Side User Details Provider can be found here.

In order to use the Server Side User Details Provider on Android, once implemented the REST integration, it will be needed to remove the provider user details provider on the KaleyraVideo singleton, if previously set.

N.B If a Server Side User Details Provider webhook has been defined server side, remember that the provider and formatter implemented by the client have more priority over the server side, so be careful as the client side implementation of the User Details Provider API will override the user details coming from the Server Side User Details Provider.

Clone this wiki locally