[TypeError] Invalid URL

I have this client code:
import { createAuthClient } from "better-auth/react";

export const { signIn, signUp, useSession, sendVerificationEmail } = createAuthClient();
import { createAuthClient } from "better-auth/react";

export const { signIn, signUp, useSession, sendVerificationEmail } = createAuthClient();
Unfortunately when I import useSession hook in my client component and use it I get this error: TypeError: Invalid URL /get-session. Are you passing in a relative URL but not setting the baseURL? I thought it is not required to set baseURL. So is this a bug or I am missing somthing here?
2 Replies
lonelyplanet
lonelyplanet4d ago
Did you follow the docs? It needs you to pass in the baseURL of the auth, see here!
Installation | Better Auth
Learn how to configure Better Auth in your project.
lonelyplanet
lonelyplanet4d ago
You also already asked for help and I gave you a solution here did you see it @samadadi ?

Did you find this page helpful?