unstale

npm / @polar-sh/better-auth

@polar-sh/better-auth

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

7 breaking4 new APIs and options2 fixes and other

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

npx @unstale/cli init

@unstale/cli on npm

@polar-sh/better-auth 212 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 3

  • Exports the type so projects that emit declarations can wrap polar() in an exported function.

    2.1.4release notes

  • 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 2

  • polarClient() is assignable to BetterAuthClientPlugin on better-auth 1.7, including 1.7.14, preserving the types of createAuthClient, inferAdditionalFields, and checkoutEmbed.

    2.1.3release notes

  • 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

@polar-sh/better-auth 11 changes

New APIs and options 1

  • Adds a proper BetterAuth plugin with org support, client support, and portal.

    1.0.0release notes