Better Auth

BA

Better Auth

Join the community to ask questions about Better Auth and get answers from other members.

Join

bug-reports

help

Recommended best practice for routing in a multi-tenant application using organization slugs?

In my app, every user must belong to an organization, and the entire user experience is scoped to a URL structure like: (baseURL)/(orgSlug)/... The frontend is built with Next.js, the backend uses Express.js, and authentication is handled with BetterAuth. ...

Hook before social signup

We have hooks before email signup, but how can we have them before social signup ? I just want an hook before signup in general (not just email and password). Bonus: It would even be better if I could execute something in a hook and cancel the registration on failure. ...

Organization member update

Can we update organization member fields in better auth, other than member role?

Social OAuth

Why does every time I create user using Social OAuth the profile image quality is bad? Is there any way to prevent this at the better-auth level? For Google default image size is 96 https://lh3.googleusercontent.com/a/...=s96-c ...

Expo + Stripe doesn't work

Hi! I'm trying to integrate expo and stripe with each other. I've encountered problem that after authClient.subscription.upgrade with status 200, it doesn't redirect to billing page neither or android or ios. Any idea? Maybe I'm missing smth? (all deps for expo are installed properly) Logs:...

NestJs + Better Auth

I followed all the step-by-step instructions from Better Auth for NestJs, but even though the console shows [Nest] 36 - 09/08/2025, 1:02:55 PM LOG [AuthModule] AuthModule initialized BetterAuth on '/api/auth/*, when I try to make a request to /api/auth/ok, I get a message saying the route was not found....
No description

Better Auth + Durable Objects

I'm using Kysely with durable objects database, which means that I do not have access to node:sqlite. I'm curious how I would configure betterAuth to use my setup?

Invalid base URL (only when running in docker)

Hello. I have setup better-auth in nuxt with bun. Running bun dev works fine. Running bun run build followed by bun preview works equally fine. My config so far is using github as login provider. But. Building the project with nixpacks, and then running the docker container gives better-auth error: `` [info] [nuxi] Starting preview command: node ./server/index.mjs`...

Workers for Platform

Issue: getting this message below when running the worker locally. Please note that app-sandbox-proxy is running on my local as well. env.DISPATCH_NAMESPACE Dispatch Namespace not supported app-sandbox-namespace (outbound -> app-sandbox-proxy) ...
No description

Expo Google sign in invalid callback URL: {"data": null, "error": {"code": "INVALID_CALLBACKURL", "m

I'm doing a React Native+Expo frontend and express backend mobile app. I want to add the google Oauth sign in. However it's not taking me to the google page for the sign in. In this case, how to set up the better auth for expo? Frontend:...

Logout redirect with cookie caching

Stack: Better Auth with cookieCache enabled TanStack Router React with AuthProvider using authClient.useSession() Node.js with Express for backend...

OAuth Token Revocation

Hi, I was wondering if there is any way to revoke access token / refresh token ? Due I would like to revoke access token when the user is revokes their session....

MFA cookie handling

Hey, I've noticed in Next.JS that when the user required to be redirected to the MFA screen, better auth client lib will create a better-auth.two_factor cookie that will expire after 3minutes from the sign-in with email was initialized, but I having trouble to find any client side method or hook to handle it's state. Should I write a custom script to handle if the cookie expired then show to the user ?

organization plugin types issue

this is my auth.ts file ``` import { betterAuth } from 'better-auth'; import { db } from '../db'; import { drizzleAdapter } from 'better-auth/adapters/drizzle';...

activeOrganizationId missing from Session type in TypeScript

When using better-auth with TypeScript, the Session type does not include the activeOrganizationId property, even when using the organization plugin. This causes type errors when trying to access authSession.session.activeOrganizationId after calling auth.api.getSession(). Steps to Reproduce: Initialize better-auth with the organization plugin....

Async plugin config?

Hey iam trying to setup the oauth plugin via database values is there any way to make this happen?

Stripe Subscriptions with multiple Products

Lets say I have multiple products that a user can buy separately from each other. Does this work? Like does the plugin then create 3 different subscriptions for the user?...

Handling Account Linking with DCR Providers

Hi, I’m building a web platform where users can add MCP servers as integrations. Some of these require OAuth with dynamic client registration (DCR). Does BetterAuth support account linking in this case, or is it only for pre-registered providers? If it is supported, what’s the recommended way to configure and persist these providers at runtime?

Call Admin routes with API key

So, I created a System user of role admin and then created an API key like this: ```typescript const apiKey = await auth.api.createApiKey({ body: {...

callbackURL doesnt work with signUp

```ts await authClient.signUp.email({ name: values.name, email: values.email, password: values.password,...