StreamUserDataStore

A DataStore managers to persist Stream user login data safely, consistently, and transactionally.

Parameters

dataStore

A DataStore that contains data type of StreamUserPreferences.

Constructors

Link copied to clipboard
constructor(dataStore: DataStore<StreamUserPreferences?>)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
val apiKey: Flow<ApiKey>

A state that contains a persisted ApiKey data.

Link copied to clipboard
val user: Flow<User?>

A state that contains a persisted User data.

Link copied to clipboard
val userDevice: Flow<Device?>

A state that contains a persisted Device data.

Link copied to clipboard
val userToken: Flow<UserToken>

A state that contains a persisted UserToken data.

Inherited properties

Link copied to clipboard
open override val data: Flow<StreamUserPreferences?>

Functions

Link copied to clipboard

Clear the persisted all user data.

Link copied to clipboard
suspend fun updateApiKey(apiKey: ApiKey)

Update ApiKey information that is used to build a StreamVideo instance for logging in.

Link copied to clipboard
suspend fun updateUser(user: User?)

Update User information that is used to build a StreamVideo instance for logging in.

Link copied to clipboard
suspend fun updateUserDevice(userDevice: Device?)

Update Device information that is used to be get push notifications from the Stream server.

Link copied to clipboard
suspend fun updateUserPreferences(streamUserPreferences: StreamUserPreferences)

Update user preferences with the give StreamUserPreferences.

Link copied to clipboard
suspend fun updateUserToken(userToken: UserToken)

Update UserToken information that is used to build a StreamVideo instance for logging in.

Inherited functions

Link copied to clipboard
open suspend override fun updateData(transform: suspend (t: StreamUserPreferences?) -> StreamUserPreferences?): StreamUserPreferences?