From d4f6e42cf62a42f7fffa7a31f6947f63cb830df4 Mon Sep 17 00:00:00 2001 From: Tyler Date: Mon, 29 Apr 2024 08:30:20 +0900 Subject: [PATCH] chore: Add comment about using SSE on the web (#907) * chore: add comment about using SSE on the web * Update packages/functions_client/lib/src/functions_client.dart Co-authored-by: Vinzent --------- Co-authored-by: Vinzent --- .../functions_client/lib/src/functions_client.dart | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/packages/functions_client/lib/src/functions_client.dart b/packages/functions_client/lib/src/functions_client.dart index fd2cc8cf..97926f50 100644 --- a/packages/functions_client/lib/src/functions_client.dart +++ b/packages/functions_client/lib/src/functions_client.dart @@ -57,6 +57,16 @@ class FunctionsClient { /// print(val); /// }); /// ``` + /// To stream SSE on the web, you can use a custom HTTP client that is + /// able to handle SSE such as [fetch_client](https://pub.dev/packages/fetch_client). + /// ```dart + /// final fetchClient = FetchClient(mode: RequestMode.cors); + /// await Supabase.initialize( + /// url: supabaseUrl, + /// anonKey: supabaseKey, + /// httpClient: fetchClient, + /// ); + /// ``` Future invoke( String functionName, { Map? headers,