track

inline suspend fun <T : Any> RealtimeChannel.track(state: T)(source)

Store an object in your presence's state. Other clients can get this data when you either join or leave the channel. Use this method again to update the state.

Example:

@Serializable
data class PresenceData(val name: String)

channel.track(PresenceData("Your Name"))

Parameters

state

the data to store (can only be something that can be encoded as a json object)