Skip to content

Commit a6b8503

Browse files
docs: update functions.fetch JSDoc to be more general
Updated the JSDoc comment to describe all use cases for the fetch method, not just streaming. Now mentions custom HTTP methods, headers, raw response access, and direct body control as additional reasons to use fetch over invoke. Co-authored-by: Netanel Gilad <netanelgilad@users.noreply.github.com>
1 parent 5862f73 commit a6b8503

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

src/modules/functions.types.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,13 @@ export interface FunctionsModule {
8282
/**
8383
* Performs a direct HTTP request to a backend function path and returns the native `Response`.
8484
*
85-
* Use this when you need streaming behavior (SSE, chunked text, NDJSON),
86-
* because `invoke()` buffers the full response.
85+
* Use this method when you need low-level control over the request/response that the higher-level
86+
* `invoke()` abstraction doesn't provide, such as:
87+
* - Streaming responses (SSE, chunked text, NDJSON)
88+
* - Custom HTTP methods (PUT, PATCH, DELETE, etc.)
89+
* - Custom headers or request configuration
90+
* - Access to raw response metadata (status, headers)
91+
* - Direct control over request/response bodies
8792
*
8893
* Requests are sent to `/api/functions/<path>`.
8994
*

0 commit comments

Comments
 (0)