supermemory/packages/lib/auth.ts
Mahesh Sanikommu 6437814f25
feat: add X-App-Source header to Nova + remove notify checkbox (#926)
Co-authored-by: Ishaan Gupta <ishaankone@gmail.com>
Co-authored-by: Vedant Mahajan <vedant.04.mahajan@gmail.com>
Co-authored-by: Akhilesh Arora <akhildawra@gmail.com>
2026-05-11 13:11:04 -07:00

32 lines
768 B
TypeScript

import {
adminClient,
anonymousClient,
apiKeyClient,
emailOTPClient,
magicLinkClient,
organizationClient,
usernameClient,
} from "better-auth/client/plugins"
import { createAuthClient } from "better-auth/react"
export const authClient = createAuthClient({
baseURL: process.env.NEXT_PUBLIC_BACKEND_URL ?? "https://api.supermemory.ai",
fetchOptions: {
credentials: "include",
headers: { "X-App-Source": "nova" },
},
plugins: [
usernameClient(),
magicLinkClient(),
emailOTPClient(),
apiKeyClient(),
adminClient(),
organizationClient(),
anonymousClient(),
],
})
export const signIn = authClient.signIn
export const signOut = authClient.signOut
export const useSession = authClient.useSession
export const getSession = authClient.getSession