// Better Auth in the browser: sign-up, sign-in and sign-out. Its requests go to /api/auth on this site, which Next // rewrites to the API, so the session cookie is set for this site. "use client"; import { createAuthClient } from "better-auth/react"; import { usernameClient } from "better-auth/client/plugins"; export const authClient = createAuthClient({ baseURL: typeof window === "undefined" ? undefined : window.location.origin, plugins: [usernameClient()], });