mirror of
https://github.com/Mail-0/Zero.git
synced 2026-06-29 15:26:42 +00:00
15 lines
510 B
TypeScript
15 lines
510 B
TypeScript
import { phoneNumberClient } from 'better-auth/client/plugins';
|
|
import { createAuthClient } from 'better-auth/react';
|
|
import type { Auth } from '@zero/server/auth';
|
|
|
|
export const authClient = createAuthClient({
|
|
baseURL: import.meta.env.VITE_PUBLIC_BACKEND_URL,
|
|
fetchOptions: {
|
|
credentials: 'include',
|
|
},
|
|
plugins: [phoneNumberClient()],
|
|
});
|
|
|
|
export const { signIn, signUp, signOut, useSession, getSession, $fetch } = authClient;
|
|
export type Session = Awaited<ReturnType<Auth['api']['getSession']>>;
|