You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+38Lines changed: 38 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -32,6 +32,7 @@ The `@vercel/sdk` is a type-safe Typescript SDK that gives you full control over
32
32
*[SDK Example Usage](#sdk-example-usage)
33
33
*[Available Resources and Operations](#available-resources-and-operations)
34
34
*[Standalone functions](#standalone-functions)
35
+
*[Json Streaming](#json-streaming)
35
36
*[File uploads](#file-uploads)
36
37
*[Retries](#retries)
37
38
*[Error Handling](#error-handling)
@@ -860,6 +861,43 @@ To read more about standalone functions, check [FUNCTIONS.md](./FUNCTIONS.md).
860
861
</details>
861
862
<!-- End Standalone functions [standalone-funcs] -->
862
863
864
+
<!-- Start Json Streaming [jsonl] -->
865
+
## Json Streaming
866
+
867
+
Json Streaming ([jsonl][jsonl-format] / [x-ndjson][x-ndjson]) content type can be used to stream content from certain operations. These operations expose the stream as an [AsyncGenerator][async-generator] that can be consumed using a `for await...of` loop in TypeScript/JavaScript. The loop will terminate when the server no longer has any events to send and closes the underlying connection.
868
+
869
+
Here's an example of consuming a JSONL stream:
870
+
871
+
```typescript
872
+
import { Vercel } from"@vercel/sdk";
873
+
874
+
const vercel =newVercel({
875
+
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
876
+
});
877
+
878
+
asyncfunction run() {
879
+
const result =awaitvercel.billing.listBillingCharges({
0 commit comments