Customer authentication


Register Customer account


Declared In

lib/modules/client/client_impl.dart

Confirm Customer account


Confirm a Client account with the confirmation token.

The The method returns the HTTP 400 status code if the account is already confirmed or 404 if the account does not exist. This method is a global operation and does not require authorization.

Declared In

lib/modules/client/client_impl.dart

Method

Future<void> confirmAccount(String token)

Parameters

Parameter Type Mandatory Default Description
token String yes - Customer’s token provided by email

Return Value

There is no return value.

Example

await Synerise.client.confirmAccount(token).catchError((error)

Activate Customer account


Declared In

lib/modules/client/client_impl.dart

Sign in a Customer


Signs a customer in to obtain a JSON Web Token (JWT) which can be used in subsequent requests.

The SDK will refresh the token before each call if it is about to expire (but not expired).

Do NOT allow signing in again (or signing up) when a customer is already signed in. First, sign the customer out.

Do NOT create multiple instances nor call this method multiple times before execution.

Declared In

lib/modules/client/client_impl.dart

Method

Future<void> signIn(String email, String password)

Parameters

Parameter Type Mandatory Default Description
email String yes - Customer’s email
password String yes - Customer’s password

Return Value

There is no return value.

Example

await Synerise.client.signIn(email,password).catchError((error)

Authenticate Customer by IdentityProvider


Use this method to authenticate with OAuth, Facebook, Google, Apple, or Synerise.

If an account for the Client does not exist and the identityProvider is different than SYNERISE, this request creates an account.

Declared In

lib/modules/client/client_impl.dart

lib/enums/client/identity_provider.dart

Method

Future<bool> authenticate(ClientAuthContext clientAuthContext, IdentityProvider identityProvider, String tokenString)

Parameters

Parameter Type Mandatory Default Description
tokenString string yes - Token retrieved from provider
identityProvider IdentityProvider yes - Provider of your token
clientAuthContext ClientAuthContext no - Object which wraps around agreements, attributes and authId

Return Value

There is no return value.

Example

await Synerise.client.authenticate(clientAuthContext, identityProvider, tokenString).catchError((error)

Check if a Customer is signed in


Check if a Customer is signed in (their token is authorized).

Declared In

lib/modules/client/client_impl.dart

Method

Future<bool> isSignedIn()

Return Value

true if the customer is signed in, otherwise returns false.

Example

final bool result = await Synerise.client.isSignedIn().catchError((error)

Sign out a Customer


Signing a Customer out clears the Customer’s JWT token.

Declared In

lib/modules/client/client_impl.dart

Method

Future<void> signOut()

Return Value

There is no return value.

Example

await Synerise.client.signOut().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