> ## Documentation Index
> Fetch the complete documentation index at: https://docs.openbridge.shop/llms.txt
> Use this file to discover all available pages before exploring further.

# .after()

> Paginate forward

```javascript theme={null}
openbridge.collections.list().after(cursor)
```

Sets the cursor for forward pagination. Use to fetch the next page.

## Parameters

| Param    | Type     | Required | Description                                 |
| -------- | -------- | -------- | ------------------------------------------- |
| `cursor` | `string` | Yes      | `pageInfo.endCursor` from previous response |

## Returns

`CollectionListBuilder` (chainable)

## Examples

### Basic pagination

```javascript theme={null}
// First page
const page1 = await openbridge.collections.list().limit(10)

// Next page
if (page1.pageInfo.hasNextPage && page1.pageInfo.endCursor) {
    const page2 = await openbridge.collections
        .list()
        .limit(10)
        .after(page1.pageInfo.endCursor)
}
```

### With search

```javascript theme={null}
const page1 = await openbridge.collections.list().search('sale').limit(10)

if (page1.pageInfo.hasNextPage && page1.pageInfo.endCursor) {
    const page2 = await openbridge.collections
        .list()
        .search('sale')
        .limit(10)
        .after(page1.pageInfo.endCursor)
}
```

### Load all collections

```javascript theme={null}
async function loadAll() {
    const all = []
    let cursor = null
    let hasMore = true

    while (hasMore) {
        let query = openbridge.collections.list().limit(100)
        if (cursor) query = query.after(cursor)

        const { items, pageInfo } = await query

        all.push(...items)
        hasMore = pageInfo.hasNextPage
        cursor = pageInfo.endCursor
    }

    return all
}
```
