When you properly initialize the SDK within your own application, on first start a UUID is generated and a JWT token is retrieved for “anonymous client”.
Such a token is required to sign all the events that are being passed to Synerise, but its permissions are limited to the following:
- Tracking events
- User registration
- User sign-in
- User password reset
This is the minimum required to use the basic features of the SDK.
The user in this scenario is fully anonymous within the system and the profile does not contain any personal information.
If you want to operate without full authentication, but still record personal information, you can do it without authentication as well.
You may have already imported client data into Synerise and you have personal information in the system. This data can be used to link mobile-related events to a user.
To achieve this, you need the add a
You can do it by passing the custom identifier:
Or by passing the email:
Synerise also offers a means to fully authenticate users and open full User sessions with a JWT token that has access to all the features provided by Synerise.
Registration as a Service
Registration as a Service (RaaS) is a set of methods that enable you to implement full user management in your application without any need for third party systems. So let’s take a look how to implement these in sections below:
New user registration
If you want to use our RaaS (Registration as a Service) you can implement the Synerise.Client.registerAccount() method.
This method provides you an option to pass all of the user information along with any agreements and attributes at once.
Please note that the email address is the primary unique identifier.
Depending on backend configuration at Synerise, registration may or may not require email confirmations.
Currently, we support the following registration behaviors:
- Automatic: the account is ready to use right after registration, no confirmations are required. User has the
snrs_email_confirmedattribute set to
- Email Confirmation Required: account is ready to use right after registration, but email confirmation is required and changes the
truein the customer profile.
- Email Activation Required: an activation email is sent and the account can only be used after activation. Activation changes the
truein the customer profile.
- The default password policy is a minimum of six characters, including at least one of each:
- uppercase letter
- lowercase letter
- non-alphanumeric character
- Passwords are PBKDF2-encrypted.
User sign in
Once your user registers, they can log in. Logins are implemented using this method: Synerise.Client.signIn().
On success, the application receives a JWT token which is valid for 1 hour (depending on backend configuration).
The SDK refreshes that token while the user is working in the application and events are being sent (auto-refresh occurs only while the token is still valid).
User sign out
Signing out uses the following method: Synerise.Client.signOut().
When called, this method terminates the JWT token and effectively kills the user session.
Get User account details
After login, you may want to present the user their profile details. This is done by using Synerise.Client.getAccount().
This method retrieves all user information that’s available in Synerise.
Update User account details
You can also let users update their profile information. The method for this is Synerise.Client.updateAccount().
With this method, a user can update most of their information, with the exception of email, because it’s used as the primary identifier for an account.
Change Users password
Separately from user information updates, a user may want to update their password. This is done with the Synerise.Client.changePassword() method.
Note that as a security measure, entering the current password is required.
For a full list of available methods, see our Methods Reference.