Packages

better-auth

1.7.25 · 14 Nov 2026MIT21M / weekRepositoryHomepagenpmAtom feed

Your version

1.4.0

22 Nov 2025Where it was published

1.7.27 is the newest release of 1.x.

In short

3 removed2 deprecated78 new2 faster193 fixed6 internal

  • Removed

    Remove deprecated ssoClient export from client plugin

  • Removed

    Remove deprecated forgetPassword endpoints

  • Removed

    organization: Remove autoCreateOnSignUp option as it's not implemented yet

  • Deprecated

    Deprecate options.advanced.generateId type

  • Deprecated

    cli: DefaultNow is deprecated in schema for Drizzle with SQLite

Security

Fixes 1 advisory that affected 1.3.34

15 advisories affect 1.4.0; 1.7.7 fixes them

10 more

Release note

Features

  • Bypass transaction with async local storage

  • Add returnHeaders to getSession

  • Waku integration guide

  • Add support for custom callback for authorization url

  • Additional fields on account

  • Add support for custom callback for token url

  • Enum support for drizzle schema

  • Nextjs 16 guide

  • Add storeStateStrategy

  • Enhance PostgreSQL support for non-public schema by respecting search_path configuration

  • Add polar oauth provider

  • Session store chunking

  • Stateless session management

  • Esm only

  • Implement automatic server-side IP detection

  • Async import in getAdapter

  • Improved API error page

  • Add request state

  • Add support for uuids

  • Auto-index CLI

  • Expose additional http methods

  • better-auth/minimal

  • Add support for custom response status codes

  • Support pass raw function as middleware

  • Support pass raw function as middleware "

  • Adapter join support

  • Refactor fetch plugins config disableDefaultFetchPlugins to include userAgentPlugin

  • Utilize database joins across better-auth

  • Support storing account data in a cookie

  • Adding support for SCIM provisioning

  • Add support for organization slug on list members

  • anonymous: Support phone number verification for account linking

  • anonymous: Allow customizing random email generator

  • captcha: Add support for CaptchaFox

  • cli: Add mcp client configs from cli

  • cli: Support Cloudflare Workers virtual module imports

  • client: Refetch session when browser state changes

  • client: Add type helper AuthClient

  • client: Introduce disableSignal client option

  • core: Replace ZodType with @standard-schema/spec

  • db: Delete hooks

  • device-authorization: Add verification uri

  • discord: Allow specification of permissions

  • email-otp: Allow returning undefined in generateOTP

  • expo: Support multiple cookie prefixes for better-auth detection

  • generic-oauth: Provide pre configured provider helpers

  • generic-oauth: Add custom token exchange support for non-standard providers

  • jwt: Support custom adapter option for jwt

  • jwt: Add JWT verification endpoint and refactor verification logic

  • jwt: Add key rotation

  • last-login-method: Update OAuth login method tracking for multiple auth type

  • last-login-method: Add support for 'siwe' as a last login method and added tests

  • mongodb: Support string IDs over ObjectIDs

  • oauth-proxy: Stateless mode compatibility

  • oidc-provider: Add RP-Initiated Logout endpoint

  • organization: Support createdAt on invitations

  • organization: Refactor organization schema to use BetterAuth types

  • passkey: Allow multiple passkey origins

  • paybin: Add Paybin OAuth provider

  • phone-number: Allow custom verifyOTP implementation

  • plugin-openapi: Allow passing nonce for CSP

  • prisma: Enhance JSON default value handling for arrays and objects in schema generation

  • session: Use JWE for cookie cache by default

  • sso: DefaultSSO options and ACS endpoint

  • sso: Provide default service provider metadata

  • sso: Add option to provide login hint

  • sso: Add domain verification for SSO providers

  • stripe: Upgrade stripe support to v19.1.0

  • stripe: Add StripePlugin type

  • stripe: Allow any scheme

  • stripe: Allow flexible types in plan limits

Bug Fixes

  • Device authorization plugin

  • Device authorization plugin

  • Reduce any type in generator.ts

  • Refresh secondary storage sessions on user update

  • Allow disable database transaction

  • Wrap Math.floor around the division when calculating TTL

  • Ttl sessions list expiration

  • Tests failing due to clock drift

  • Refresh secondary storage sessions on user update

  • Refresh secondary storage sessions on user update

  • Support compressed ipv6 format

  • Add required constraint to slug filed in org plugin

  • Use consistent messaging on requestPasswordReset

  • Cookie size limit shouldn't throw error

  • Handle symbols in proxy get trap to prevent TypeError

  • Ttl for rate limited secondary storage

  • Properly encode callback url for email verificaiton

  • Session update database hook should expect partial session type

  • Deprecated

    Deprecate options.advanced.generateId type

  • Api keys should properly check if a request is from client or server

  • Refactor account deletion functions to trigger database hooks

  • Improve username transformation logic

  • Ensure falsy values are valid default values

  • Import node:async_hooks directly

  • Undeclared variable reference on docs

  • Argument where of type TwoFactorWhereUniqueInput needs at least one of id arguments

  • Mobile ai search responsiveness

  • Type compatibility with exactOptionalPropertyTypes

  • Removed

    Remove deprecated ssoClient export from client plugin

  • GetAcccessToken refresh should properly refresh when oauth tokens are encrypted

  • Resolve custom URL scheme origin matching with wildcards

  • Respect additionalFields returned config for user data when setting cookie cache

  • Correct type HookEndpointContext and InternalContext

  • Add optional chaining for process.platform

  • User-agent requirement when fetching from clients

  • Unused peer dependency

  • Rename sha to branch and made it canary by default

  • Removed

    Remove deprecated forgetPassword endpoints

  • Respect onAPIError.errorURL in OAuth callback flow

  • Call db hooks when calling deleteUser

  • Allow user update to handle additional fields and validation

  • Missing email validation

  • Urls without protocol shouldn't be able to satisfy a wildcard origin

  • Use standard validator

  • Add undefined type for optional property types

  • Type mismatch for 'banned' on UserWithRole

  • Delete duplicate email existence check in changeEmail endpoint

  • Add missing userId in listAccounts response

  • Trigger use session on revoke sessions

  • string inference for additionalFields

  • Unsanitized endpoints provided dates will cause DB insert failure

  • Update hooks return should merge with original data

  • Dont trigger session refresh on magic-link sign-in

  • Treat generateId "serial" as numeric ID and correct UUID column types across adapters

  • Validate baseURL protocol and improve error messages

  • Use ctx over request in plugin options

  • Use identity instead of serial for pg schema

  • Zoom refresh token

  • /change-email should trigger session signal

  • Resolve SESSION_IS_NOT_FRESH error with cookieCache

  • Preserve provided string IDs in the MongoDB adapter when they are not valid ObjectId

  • GenericOAuth and SSO ignore discoveryUrl for authorization

  • Remove active session requirement for change email verification

  • adapter: Returning null as string for optional id references

  • adapter: Use updated field values in WHERE clause during update

  • adapter: Foreign keys that are nullable on number ids can return string of null

  • adapter: Ensure transaction function is implemented in the adapter

  • adapter: Missing data type transformation on where clauses

  • adapter: Inconsistent mongo ends_with query

  • adapter: Kysely with CamelCasePlugin breaks for OIDC.

  • adapter: Should not apply defaultValue during find calls

  • adapter: Drizzle deleteMany result should be a number

  • adapters: Mongodb id issue

  • admin: Stricter body validation with the setUserPassword api

  • admin: Validate admin role updates against the configured roles to prevent setting a non-existent role

  • anonymous: Provide ctx on accountLink

  • anonymous: isAnonymous should default to false instead of null

  • api-key: Cascade api keys on user deletion

  • api-key: Cascade api keys on user deletion

  • api-key: Calling client on server side

  • api-key: Correct refill interval time calculation

  • api-key: Shouldn't issue api key a mock session by default

  • api-key: Don't update the lastRequest when calling updateApiKey

  • api-key: Remove incorrect usage tracking in updateApiKey

  • better-auth: Moved email verification check after password check

  • Deprecated

    cli: DefaultNow is deprecated in schema for Drizzle with SQLite

  • cli: Timestamp in schema for Drizzle with SQLite

  • cli: Move type dependencies to devDependencies

  • client: BaseURL is undefined for SSR

  • client: Add lynx client exports

  • client: Missing isRefetching type in react useSession

  • client: Ensure refetchInterval triggers active network request

  • cookie: SameSite to "none" for oauth state

  • cookie: SameSite to "none" for oauth state "

  • core: Correctly set typesVersions paths

  • create-adapter: Disable transaction by default

  • custom-session: Don't overwrite the Set-Cookie header

  • custom-session: Infer.Session to infer the return type of the custom session

  • db: onDelete is ignored

  • db: Postgres - explicitly define pg_catalog for gen_random_uuid()

  • device-authorization: Fix client error type for deny device

  • device-authorization: Sanitize user code input on device approve

  • drizzle: Replace pgEnum with text enum type in Drizzle schema generation

  • drizzle-adapter: Handle all operators in multiple where conditions

  • email-otp: Call reset password callback

  • email-otp: Email-verification doesn't trigger session signal

  • email-otp: Fix openapi schema for /email-otp/verify-email endpoint

  • email-otp: Prevent duplicate verification emails when override is enabled

  • email-otp: Prevent user enumeration on email OTP

  • email-otp: Use constant time equal for equality checks

  • expo: Set-header retrigger $sessionSignal

  • expo: Store normalized cookie name in storage

  • expo: Origin check failing due to null origin in expo

  • expo: Account linking flow on mobile

  • expo: Clear peer dependence and flag optional

  • expo: Enhance cookie detection for better-auth cookies

  • generic-oauth: overrideUserInfo doesn't work

  • generic-oauth: Await async mapProfileToUser

  • gitlab: Fix the token endpoint

  • haveibeenpwned: Check for limited set of paths

  • last-login-method: Custom resolver method default logic

  • last-login-method: LastLoginMethod cookie is not set when using a generic oauth provider

  • last-login-method: Detect passkey login to set last used method

  • magic-link: Avoid returning error for disabled signup early

  • magic-link: Ensure emailVerified update is reflected in user object

  • mcp: Missing Content-Type header for mcp DCR

  • mcp: Consent requirement should be respected

  • mongodb: Mongodb findOneAndUpdate should return .value

  • multi-session: Reject cookies without valid signatures on signout hook

  • nuxt: Avoid load env base url for SSR

  • oauth: Redirect to GET for POST method

  • oauth-proxy: Should skip state check for oauth proxy

  • oauth-proxy: Handle cross-origin flows

  • oauth-proxy: Return multiple Set-Cookie headers instead of a single comma-separated header

  • oauth2: Fix user data not reflecting provider updates with overrideUserInfo

  • odic: Case when prompt=login

  • odic: Case when prompt=login "

  • odic-provider: Default options

  • oidc: Properly enforce consent requirements per OIDC spec

  • oidc-provider: OIDC token-type capitalization

  • oidc-provider: Use consistent iat claim and allow configurable issuer

  • oidc-provider: Improve typing

  • oidc-provider: oidc_login_prompt not cleared after login

  • oidc-provider: Change updated_at to be a UNIX numeric timestamp

  • oidc-provider: Fix opts order

  • oidc-provider: oidc_login_prompt not cleared after login "

  • oidc-provider: Missing options

  • oidc-provider: Implement proper OIDC prompt parameter handling

  • oidc-provider: Redirect to consent when scope changed

  • openapi: Add operationIds to routes

  • org: Use correct adapter during db tranaction

  • org: Update type to include undefined

  • organization: Decouple client and server permission checks

  • organization: Decouple client and server permission checks

  • organization: Membership check for organizations with large member counts

  • Removed

    organization: Remove autoCreateOnSignUp option as it's not implemented yet

  • organization: Pass ctx to DB hooks

  • organization: Allow passing id through beforeCreateOrganization

  • organization: Prevent empty name and slug in create/update

  • organization: Certain parameters not showing in client types

  • organization: Prevent duplicate slug on organization update

  • organization: Compatibility with declaration on tsconfig.json

  • organization: Compatibility with exactOptionalPropertyTypes

  • organization: Typecheck node exceeds the maximum length

  • organization: Fix the schema type

  • organization: RemoveTeamMember breaks for prisma

  • organization: Correct migration order when dynamicAccessControl is enabled

  • organization: Deleting member from org doesn't delete them from teams

  • organization: All endpoints should properly infer additional fields

  • organization: ActiveOrgId no longer inferred after enabling dynamic AC

  • passkey: Remove email from query

  • passkey: Atom listeners not working

  • passkey: Passkey breaks with throw: true

  • passkey: Wrong Session type being used on passkey

  • passkey: Filter delete passkey with userId

  • passkey: Ensure addPasskey returns passkey data instead of undefined

  • phone-number: Shouldn't allow updating phone number on /update-user endpoint

  • session: Refresh cache before it expires

  • session: Persist additionalFields in cookie cache

  • social-providers: Core module import

  • sso: Safe json parsing for saml/oidc configs

  • sso: Prevent duplicate SSO provider creation with same providerId

  • sso: OIDC scopes should fallback to provider scopes

  • sso: Add deprecated flag to the old sso plugin export

  • sso: Move oauth2-mock-server dep into devDependencies for sso package

  • sso: Use the internalAdapter for user queries to avoid skipping database hooks

  • sso: Respect disableImplicitSignUp in SAML callback

  • sso: Prevent server instance from leaking to client

  • sso: Export SSOProvider type

  • stripe: OnCustomerCreate should be called even if update user isn't returned

  • stripe: Update with an existing subscription

  • stripe: Sync customer email on db change

  • stripe: getCustomerCreateParams not actually being called

  • stripe: Throw error if event failed to be constructed

  • stripe: Check for reference IDs inside during Stripe reference validation

  • stripe: Stripe error codes should be returned from the plugin

  • stripe: Remove TS error suppression updating getCheckoutSessionParams

  • stripe: Prevent duplicate customer creation on signup

  • stripe: Return updated subscription in onSubscriptionUpdate callback

  • stripe: Throw error if query.referenceId is defined

  • stripe: Cancel subscription fails with Prisma

  • telemetry: Avoid async import if telemetry disabled, fix for esbuild

  • telemetry: Avoid async import if telemetry disabled, fix for esbuild "

  • two-factor: Return parsed array in viewBackupCodes

  • two-factor: Backup codes shouldn't be encrypted twice

  • two-factor: Avoid GET endpoints with body

  • two-factor: Incorrect reference for server only actions

  • two-factor: Improve error message for bad totp code in 2FA setup

  • two-factor: Trust device token refresh

  • two-factor: Use constant time equal for otp comparison

  • types: Include null in getSession return type

  • url: Handle empty and root path in withPath, prevent double slashes, add tests

  • username: Username should respect send on sign config

  • username: Compacity with exactOptionalPropertyTypes

  • vk: Check for empty email after user profile mapping

Performance

  • Improve type Auth

  • Lazy load create telemetry

  • Lazy load create telemetry "

A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.