Files
better-auth/demo/nextjs/lib/auth-client.ts
Bereket Engida 350492790d demo: fix types
2024-09-23 15:20:02 +03:00

31 lines
504 B
TypeScript

import { createAuthClient } from "better-auth/react";
import {
organizationClient,
passkeyClient,
twoFactorClient,
} from "better-auth/client/plugins";
export const client = createAuthClient({
plugins: [
organizationClient(),
twoFactorClient({
twoFactorPage: "/two-factor",
}),
passkeyClient(),
],
fetchOptions: {
credentials: "include",
},
});
export const {
signUp,
signIn,
signOut,
useSession,
user,
organization,
useListOrganizations,
useActiveOrganization,
} = client;