Skip to content

Commit

Permalink
SDK generation
Browse files Browse the repository at this point in the history
  • Loading branch information
fern-support authored Jul 26, 2024
1 parent 98fd099 commit 0d69351
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,36 @@ try {
}
```

## Automatic Pagination

List endpoints are paginated. The SDK provides an iterator so that you
can simply loop over the items:

```ts
const result = await client.events.list();
for await (const event of result) {
console.log(event);
}
```

You can also iterate page-by-page:

```ts
let page = await client.events.list();
for (const event of page.data) {
console.log(event);
}
```

or manually:

```ts
while (page.hasNextPage()) {
page = page.getNextPage();
// ...
}
```

## Advanced

### Retries
Expand Down

0 comments on commit 0d69351

Please sign in to comment.