User Creation
User Creation On the SDK
Last updated
User Creation On the SDK
Last updated
Each Sentiance user is linked to a unique user on your system. When creating a new Sentiance user, we ask you to provide to us an identifier that points to a unique user in your system.
The process of linking your system user to a Sentiance user requires a server-to-server interaction. The Sentiance SDK does not accept your system's user identifier directly. In order for us to do the user linking, we need a trusted source to provide us the user identifier. We do not consider a mobile app to be a trusted source. Instead, we require you to send the request from your server, and use a Sentiance API Key to authenticate it. You can generate this API key in our . You must never transmit this key to your app.
You provide to us your system user identifier when making an . In return, Sentiance will provide to you a short-lived authentication code, which you will then use to create a Sentiance user on the device.
The steps are as follows:
When decided to create a Sentiance user, contact your backend and request a Sentiance authentication code.
On your backend, towards the Sentiance backend, which will include your user's unique identifier. This request is authenticated using a Sentiance API Key.
Retrieve the authentication code provided by Sentiance and forward it to your app.
In the app, create a Sentiance user by passing this authentication code.
Once you have retrieved the authentication code, pass it to the SDK's user creation method. The SDK will make a request towards the Sentiance backend, which will include this code and some additional information about your app and the device. In return, the Sentiance backend will respond with a unique Sentiance user identifier, and an SDK configuration.
The SDK supports the presence of only one Sentiance user on the device at a time. If your app supports multiple users (e.g. via a login flow), you can utilize the SDK's reset
functionality to remove the existing user from the device, before creating a new one.
We realize that users can migrate to different devices, or reinstall your app on the same device. As such, we support restoring a Sentiance user during user creation.
During the authentication code request, when you provide to us your system user identifier, we will first look up to see whether this ID is already linked to an existing Sentiance user. If so, we will not create a new Sentiance user. Instead, we will provide to you an authentication code that is linked to the existing Sentiance user. When the SDK forwards this code to our backend, we will restore this existing Sentiance user instead.