Files
Zero/lib/auth-client.ts
2025-02-14 02:07:36 -05:00

11 lines
429 B
TypeScript

import { customSessionClient } from "better-auth/client/plugins";
import { createAuthClient } from "better-auth/react";
import type { auth } from "@/lib/auth"; // Import the auth instance as a type
export const authClient = createAuthClient({
baseURL: process.env.NEXT_PUBLIC_APP_URL,
plugins: [customSessionClient<typeof auth>()],
});
export const { signIn, signUp, signOut, useSession, getSession, $fetch } = authClient;