invokeSSE
Invokes a remote edge function that returns Server-Sent Events (SSE) and returns a Flow of FunctionServerSentEvent. Each event provides access to data, event, and id fields, as well as a decodeAs method for deserializing the data payload.
The authorization token is automatically added to the request. Ktor's SSE plugin requires direct io.ktor.client.HttpClient access, so this method uses the raw client with api.getDefaultHeaders to include the authentication token (base headers like apikey are already applied by Ktor's DefaultRequest plugin).
Return
A Flow of FunctionServerSentEvent representing the SSE stream
Parameters
The function to invoke. If name of the function is renamed, use the slug after URL
The region where the function is invoked
The request builder to configure the request
Throws
if the request timed out
on network related issues