Skip to content

teams.getTeamMembers silently truncates (API out of sync with SDK) #354

Description

@gmathieu

GET /v3/teams/{teamId}/members returns pagination: { nextPageCursor }, but
the SDK still expects the older { hasNext, count, next, prev }.

The API never sends those four keys. Instead of erroring, the SDK fills in a
default for each one it can't find — false for the boolean, 0 for the
number, null for the nullable ones. So pagination always comes back as
{ hasNext: false, count: 0, next: null, prev: null }: a valid-looking object
with misleading information.

A paging loop reads next: null as "last page" and silently stops after the
first page.

Repro (team with more than 2 members)

const { members, pagination } = await vercel.teams.getTeamMembers({
  limit: 2,
  teamId,
})
// members.length === 2
// pagination      === { hasNext: false, count: 0, next: null, prev: null }

Actual: pagination reports no next page, so paging stops after 2 of 17
members. Expected: the cursor the API returned, so the remaining members can be
fetched.

Same request, raw:

curl -s -H "Authorization: Bearer $TOKEN" \
  "https://api.vercel.com/v3/teams/$TEAM_ID/members?limit=2" | jq '{pagination, totalCount}'
{
  "pagination": { "nextPageCursor": "eyJhY2..." },
  "totalCount": 17
}

The cursor round-trips correctly as ?nextPageCursor=<value>, so paging works
over raw HTTP but not SDK.

Cause

https://openapi.vercel.sh/ still describes the old shape for this endpoint.
nextPageCursor and totalCount are not in the spec at all, so the SDK doesn't
know about them.

It's data loss, not just missing types: the SDK drops keys it doesn't recognise,
so the real cursor and totalCount are gone from the object you get back.

Environment

  System:
    OS: macOS 26.5.2
    CPU: (11) arm64 Apple M3 Pro
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 24.18.0
    npm: 11.16.0
    pnpm: 11.21.0
    bun: 1.3.14
  npmPackages:
    @vercel/sdk: 1.28.19 => 1.28.19

Also tested against 1.28.17

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions