FunctionServerSentEvent

class FunctionServerSentEvent(val data: String?, val event: String?, val id: String?, serializer: SupabaseSerializer)(source)

Represents a Server-Sent Event received from an edge function.

This is a wrapper around Ktor's io.ktor.sse.ServerSentEvent that adds decodeAs for conveniently deserializing the data payload using the Functions plugin's serializer.

Constructors

Link copied to clipboard
constructor(data: String?, event: String?, id: String?, serializer: SupabaseSerializer)

Properties

Link copied to clipboard
val data: String?

The event data payload, if present

Link copied to clipboard

The event type, if present

Link copied to clipboard
val id: String?

The event ID, if present

Functions

Link copied to clipboard
inline fun <T> decodeAs(): T

Decodes the data payload as the specified type T using the Functions plugin's serializer.