From bb68f8e78fa6e486837e85ee8000376daaf212ed Mon Sep 17 00:00:00 2001 From: Alex Yang Date: Mon, 12 Jan 2026 15:27:35 -0800 Subject: [PATCH] docs: update `faq.mdx` (#7309) --- docs/content/docs/reference/faq.mdx | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/docs/content/docs/reference/faq.mdx b/docs/content/docs/reference/faq.mdx index 738ca44fc6..88ff649cb1 100644 --- a/docs/content/docs/reference/faq.mdx +++ b/docs/content/docs/reference/faq.mdx @@ -6,7 +6,7 @@ description: Frequently asked questions about Better Auth. This page contains frequently asked questions, common issues, and other helpful information about Better Auth. - + When encountering `createAuthClient` related errors, make sure to have the correct import path as it varies based on environment. If you're using the auth client on react front-end, you'll need to import it from `/react`: @@ -23,7 +23,7 @@ import { createAuthClient } from "better-auth/client"; - + If you try to call `authClient.getSession` on a server environment (e.g, a Next.js server component), it doesn't work since it can't access the cookies. You can use the `auth.api.getSession` instead and pass the request headers to it. ```tsx title="server.tsx" @@ -49,13 +49,13 @@ const session = await authClient.getSession({ ``` - + Better Auth provides a type-safe way to extend the user and session schemas, take a look at our docs on extending core schema. - + Both `useSession` and `getSession` instances are used fundamentally different based on the situation. `useSession` is a hook, meaning it can trigger re-renders whenever session data changes. @@ -78,7 +78,7 @@ For all other situations where you shouldn't use `useSession`, is when you shoul - + If you're facing typescript errors, make sure your tsconfig has `strict` set to `true`: ```json title="tsconfig.json" { @@ -99,21 +99,15 @@ if you can't set strict to true, you can enable strictNullChecks: You can learn more in our TypeScript docs. - + At this time, you can't remove the `name`, `image`, or `email` fields from the user table. We do plan to have more customizability in the future in this regard, but for now, you can't remove these fields. - + If you're encountering errors like: -``` -Better Auth was already imported. This breaks async local storage instance and will lead to issues! -``` - -Or like: - ``` No request state found. Please make sure you are calling this function within a `runWithRequestState` callback. ```