supermemory/packages/lib/auth.ts
MaheshtheDev f8a2b0046e feat: add X-App-Source header to Nova API clients + remove notify checkbox
- Add X-App-Source: nova header to $fetch, authClient, AutumnProvider, and raw fetch calls
- Remove notify-when-deleted checkbox from account deletion dialog (emails now always sent)
2026-05-10 21:03:23 +00: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