Customer session


Refresh customer token


This method refreshes the customer’s current token.

Note: Returns an error if the token has expired and cannot be refreshed.

Declared In:
lib/main/modules/ClientModule.js

Class:
ClientModule

Declaration:

public refreshToken(onSuccess: () => void, onError: (error: Error) => void)

Parameters:

Parameter Type Mandatory Default Description
onSuccess Function no - Function to be executed when the operation is completed successfully
onError Function no - Function to be executed when the operation is completed with an error

Return Value:
No value is returned.

Example:

Synerise.Client.refreshToken(function(token) {
  // success
}, function(error) {
  // failure
});

Retrieve customer token


This method retrieves the customer’s current, active token.

Note: Returns an error if the token has expired and cannot be retrieved.

Declared In:
lib/main/modules/ClientModule.js

Related To:
Token

Class:
ClientModule

Declaration:

public retrieveToken(onSuccess: (token: Token) => void, onError: (error: Error) => void)

Parameters:

Parameter Type Mandatory Default Description
onSuccess Function no - Function to be executed when the operation is completed successfully
onError Function no - Function to be executed when the operation is completed with an error

Return Value:
No value is returned.

Example:

Synerise.Client.retrieveToken(function(token) {
  // success
}, function(error) {
  // failure
});

Get current customer UUID


This method retrieves the customer’s current UUID.

Declared In:
lib/main/modules/ClientModule.js

Class:
ClientModule

Declaration:

public getUUID(): string

Return Value:
The method returns the customer’s UUID as string.

Example:

let uuid = Synerise.Client.getUUID();

Regenerate customer


This method regenerates the UUID and clears the authentication token, login session, custom email, and custom identifier.

This operation works only if the customer is anonymous.

This operation clears the authentication token, login (if applicable), custom email, and custom identifier.

iOS SDK Android SDK React Native SDK Flutter SDK
Introduced in: 3.3.10 3.3.5 0.9.0 0.7.0

Declared In:
lib/main/modules/ClientModule.js

Class:
ClientModule

Declaration:

public regenerateUUID()

Return Value:
No value is returned.

Example:

Synerise.Client.regenerateUUID();

Regenerate customer with identifier


This method regenerates the UUID and clears the authentication token, login session, custom email, and custom identifier.

This operation works only if the customer is anonymous.

This operation clears the authentication token, login (if applicable), custom email, and custom identifier

The optional clientIdentifier parameter is a seed for UUID generation.

iOS SDK Android SDK React Native SDK Flutter SDK
Introduced in: 3.6.5 3.6.4 0.9.10 0.7.2

Declared In:
lib/main/modules/ClientModule.js

Class:
ClientModule

Declaration:

public regenerateUUIDWithClientIdentifier(clientIdentifier: string)

Parameters:

Parameter Type Mandatory Default Description
clientIdentifier string no - Seed for UUID generation
Note: The clientIdentifier parameter is used for decreasing the number of UUID refreshes, so it must be unique for every customer.

Return Value:
No value is returned.

Destroy current session


This method destroys the session completely.

This method clears all session data (both client and anonymous) and removes cached data. Then, it regenerates the UUID and creates the new anonymous session.

Declared In:
lib/main/modules/ClientModule.js

Class:
ClientModule

Declaration:

public destroySession()

Return Value:
No value is returned.

Example:

Synerise.Client.destroySession();

😕

We are sorry to hear that

Thank you for helping improve out documentation. If you need help or have any questions, please consider contacting support.

😉

Awesome!

Thank you for helping improve out documentation. If you need help or have any questions, please consider contacting support.

Close modal icon Placeholder alt for modal to satisfy link checker