Customer Session


Retrieve Customer token


Retrieves the Customer’s current, active token.

An error is returned when the Customer is not logged in or the token has expired and cannot be refreshed.

Declared In

lib/main/modules/ClientModule.js

lib/classes/Token/Token.js

Method

Synerise.Client.retrieveToken(onSuccess, onError)

Parameters

Parameter Type Mandatory Default Description
onSuccess function no - Callback function to be executed when the operation finishes successfully
onError function no - Callback function to be executed when the operation finishes unsuccessfully

Return Value

There is no return value.

Example

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

Get current Customer UUID


Retrieve the Customer’s current UUID.

Declared In

lib/main/modules/ClientModule.js

Method

Synerise.Client.getUUID()

Return Value

Method returns the Customer’s UUID as string.

Example

let uuid = Synerise.Client.getUUID();

Regenerate Customer UUID


Regenerate the UUID and clear the authentication token, login session, custom email, and custom identifier.

This operation works only if the Customer is anonymous.

Declared In

lib/main/modules/ClientModule.js

Method

Synerise.Client.regenerateUUID()

Return Value

true if the Current Customer is anonymous and the operation succeed, false otherwise.

Example

Synerise.Client.regenerateUUID();
😕

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.