unstale

npm / @polar-sh/better-auth

@polar-sh/better-auth

What changed in @polar-sh/better-auth 2, from its official release notes, upgrade guides and advisories. Sources checked 2026-10-19.

7 breaking2 new APIs and options1 fixes and other

See which of these apply to your code, ranked, in your agent:

npx @unstale/cli init

@unstale/cli 0.2.0 on npm

@polar-sh/better-auth 210 changes

Breaking changes 7

  • The peer dependency now requires Better Auth ^1.7.0.

    2.0.0release notes

  • Create the client option with createPolarCore instead of createPolar, importing it from @polar-sh/sdk/2026-10.

    2.0.0release notes

  • Existing customers without an external ID retain one-time linking, while conflicting customer identities are rejected rather than replacing an immutable external ID.

    2.0.0release notes

  • The relink path now filters to individual customers and throws CONFLICT if a team customer already holds the signup email, preventing its external_id from being overwritten.

    2.0.0release notes

  • Custom plugins passed through use now receive a PolarCore and must use standalone SDK functions with it.

    2.0.0release notes

  • For client calls to endpoints that also accept a body, pass query parameters through fetchOptions rather than as a top-level query.

    2.0.0release notes

  • Anonymous sessions are rejected before their session ID is forwarded as Polar externalCustomerId, preventing orphan meter events.

    2.0.0release notes

New APIs and options 2

  • Checkout creation now sends the visitor's IP address, resolved with Better Auth's getIP and advanced.ipAddress settings. Set customerIpAddress to resolve it yourself or false to stop sending it.

    2.1.0release notes

  • Checkout requests support discount_code, applying it before redirecting or opening embedded checkout; discount codes must be enabled, and discount_id takes precedence.

    2.0.0release notes

Fixes and other changes 1

  • Signup customers are created after Better Auth inserts the user, with the user ID included in the initial Polar request; rejected before-create hooks skip Polar calls.

    2.0.0release notes