supermemory/packages/lib/auth.ts
Dhravya Shah 62cc57eda6
Some checks failed
Publish AI SDK / publish (push) Has been cancelled
Publish Memory Graph / publish (push) Has been cancelled
Publish Tools / publish (push) Has been cancelled
fix(auth): upgrade Better Auth to patched 1.7.6 (#1719)
Co-authored-by: Mahesh Sanikommu <maheshthedev@gmail.com>
2026-10-02 17:05:13 -07:00

32 lines
812 B
TypeScript

import { apiKeyClient } from "@better-auth/api-key/client"
import {
adminClient,
anonymousClient,
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