Table of Contents

Class ChannelOptions

Namespace
Supabase.Realtime.Channel
Assembly
Supabase.Realtime.dll

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

clientOptions ClientOptions

The client configuration options.

retrieveAccessToken Func<string>

A function that returns the current access token.

serializerSettings JsonSerializerSettings

The JSON serializer settings to be used for message serialization.

Properties

ClientOptions

The Client Options

public ClientOptions ClientOptions { get; }

Property Value

ClientOptions

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

bool

Parameters

Parameters that are sent to the channel when opened (JSON Serializable)

public Dictionary<string, string>? Parameters { get; set; }

Property Value

Dictionary<string, string>

RetrieveAccessToken

A function that returns the current access token.

public Func<string?> RetrieveAccessToken { get; }

Property Value

Func<string>

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

clientOptions ClientOptions

The client configuration options.

retrieveAccessToken Func<string>

A function that returns the current access token.

serializerSettings JsonSerializerSettings

The JSON serializer settings to be used for message serialization.

Returns

ChannelOptions

Public(ClientOptions, Func<string?>, JsonSerializerSettings)

Creates options for a public channel.

public static ChannelOptions Public(ClientOptions clientOptions, Func<string?> retrieveAccessToken, JsonSerializerSettings serializerSettings)

Parameters

clientOptions ClientOptions

The client configuration options.

retrieveAccessToken Func<string>

A function that returns the current access token.

serializerSettings JsonSerializerSettings

The JSON serializer settings to be used for message serialization.

Returns

ChannelOptions