Class ChannelOptions
Represents configuration options for a Realtime channel.
public class ChannelOptions
- Inheritance
-
ChannelOptions
- Inherited Members
Remarks
This class contains all the necessary configuration options for establishing and maintaining a Realtime channel connection, including authentication, parameters, and serialization settings.
Constructors
ChannelOptions(ClientOptions, Func<string?>, JsonSerializerSettings)
The Channel Options (typically only called from within the Client). Creates options for a public channel; use Private(ClientOptions, Func<string?>, JsonSerializerSettings) for a private one.
public ChannelOptions(ClientOptions clientOptions, Func<string?> retrieveAccessToken, JsonSerializerSettings serializerSettings)
Parameters
clientOptionsClientOptionsThe client configuration options.
retrieveAccessTokenFunc<string>A function that returns the current access token.
serializerSettingsJsonSerializerSettingsThe JSON serializer settings to be used for message serialization.
Properties
ClientOptions
The Client Options
public ClientOptions ClientOptions { get; }
Property Value
IsPrivate
Whether the channel is private, i.e. authorized against the server's Row Level Security policies. Private channels are required for broadcast replay.
public bool IsPrivate { get; }
Property Value
Parameters
Parameters that are sent to the channel when opened (JSON Serializable)
public Dictionary<string, string>? Parameters { get; set; }
Property Value
RetrieveAccessToken
A function that returns the current access token.
public Func<string?> RetrieveAccessToken { get; }
Property Value
SerializerSettings
The Serializer Settings
public JsonSerializerSettings SerializerSettings { get; }
Property Value
- JsonSerializerSettings
Methods
Private(ClientOptions, Func<string?>, JsonSerializerSettings)
Creates options for a private channel, i.e. one authorized against the server's Row Level Security policies. Required for broadcast replay.
public static ChannelOptions Private(ClientOptions clientOptions, Func<string?> retrieveAccessToken, JsonSerializerSettings serializerSettings)
Parameters
clientOptionsClientOptionsThe client configuration options.
retrieveAccessTokenFunc<string>A function that returns the current access token.
serializerSettingsJsonSerializerSettingsThe JSON serializer settings to be used for message serialization.
Returns
Public(ClientOptions, Func<string?>, JsonSerializerSettings)
Creates options for a public channel.
public static ChannelOptions Public(ClientOptions clientOptions, Func<string?> retrieveAccessToken, JsonSerializerSettings serializerSettings)
Parameters
clientOptionsClientOptionsThe client configuration options.
retrieveAccessTokenFunc<string>A function that returns the current access token.
serializerSettingsJsonSerializerSettingsThe JSON serializer settings to be used for message serialization.