// Better Auth in the browser: sign-up, sign-in (with a two-factor code when it's on), sign-out, and two-factor setup. // 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 { twoFactorClient, usernameClient } from "better-auth/client/plugins"; export const authClient = createAuthClient({ baseURL: typeof window === "undefined" ? undefined : window.location.origin, plugins: [usernameClient(), twoFactorClient()], });