Customer session


Refresh customer token


This method refreshes the customer’s current token.

This method requires customer authentication.

Note: Returns an error if the customer is not logged in or the token has expired and cannot be refreshed.

Declared In:
lib/modules/client/client_impl.dart

Class:
ClientImpl

Declaration:

Future<bool> refreshToken() async 

Return Value:
true if the operation is success, otherwise it throws an error.

Example:

await  Synerise.client.refreshToken().catchError((error)

Retrieve customer token


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

This method requires customer authentication.

Note: Returns an error if the customer is not logged in or the token has expired and cannot be refreshed.

Declared In:
lib/modules/client/client_impl.dart

Class:
ClientImpl

Declaration:

Future<Token> retrieveToken() async 

Return Value:
Token

Example:

Token token = await  Synerise.client.retrieveToken().catchError((error)

Get current customer UUID


This method retrieves the customer’s current UUID.

Declared In:
lib/modules/client/client_impl.dart

Class:
ClientImpl

Declaration:

Future<String> getUUID() async 

Return Value:
String

Example:

String uuid = await  Synerise.client.getUUID().catchError((error)

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.

Declared In:
lib/modules/client/client_impl.dart

Class:
ClientImpl

Declaration:

Future<void> regenerateUUID() async 

Return Value:
No value is returned.

Example:

await  Synerise.client.regenerateUUID().catchError((error)

Regenerate customer with identifier


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

The optional clientIdentifier parameter is a seed for UUID generation.

Note: This operation works only if the customer is anonymous.

Declared In:
lib/modules/client/client_impl.dart

Class:
ClientImpl

Declaration:

Future<void> regenerateUUIDWithClientIdentifier(String clientIdentifier) async {

Parameters:

Parameter Type Mandatory 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.

Example:

await Synerise.client.regenerateUUIDWithClientIdentifier(clientIdentifier).catchError((error) {

Destroy current session


This method destroys the whole session completely.

Declared In:
lib/modules/client/client_impl.dart

Class:
ClientImpl

Declaration:

Future<void> destroySession() async

Return Value:
No value is returned.

Example:

await  Synerise.client.destroySession().catchError((error)

😕

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