Skip to content

Typescript SDK introduced breaking changes in v0.41.5 -> v0.42.0 on polar.events.list() #9354

@dugjason

Description

@dugjason

Description (tl;dr)

In the change from v0.41.5 -> v0.42.0, the polar.events.list() method return signature changed from an iterator to a simple {items, pagination} object (no iterator)
polarsource/polar-js@6aa520c#diff-b195183c950774c1c79f0215a1ac47bd06feb24491df8dc5770c31d22a627391

What is the expected behaviour?

I would not expect a breaking change in a minor SDK version update

What errors or issues are you experiencing?

No response

How can it be reproduced?

Load up the following code in your IDE on versions v0.41.* vs v0.42.*

      const iterator = await polar.events.list({
        externalCustomerId,
        name,
        startTimestamp,
        endTimestamp,
        limit,
        sorting: ["-timestamp"],
      })
      const events: PolarEvent[] = []
      for await (const page of iterator) {
        events.push(...page.result.items)
      }

v0.41.* is OK
v0.42.* shows missing async iterator error;

Image

Which adapter(s) does this relate to?

  • Next.js
  • BetterAuth
  • Nuxt
  • Remix
  • TanStack Start
  • SvelteKit
  • Supabase
  • Astro
  • Deno
  • Elysia
  • Express
  • Fastify
  • Hono
  • Others (please specify in the description)

What environment are you running it in?

Local IDE + Vercel build env

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions