setUserToken method

AlgoliaSettings setUserToken({
  1. required String value,
})

UserToken

Associates a certain user token with the current search.

Sending a user token will associate a search with a certain user. The insights taken from this could be used in combination with personalization for example. The user token has to be an alpha-numeric string with a maximum amount of 64 characters.

Source: Learn more

Implementation

AlgoliaSettings setUserToken({required String value}) {
  assert(value.isNotEmpty, 'value can not be empty');
  assert(!_parameters.containsKey('userToken'));
  return _copyWithParameters(<String, dynamic>{'userToken': value});
}