diff options
| author | Mahesh Sanikommmu <[email protected]> | 2025-08-16 18:50:10 -0700 |
|---|---|---|
| committer | Mahesh Sanikommmu <[email protected]> | 2025-08-16 18:50:10 -0700 |
| commit | 39003aff23d64ff1d96074d71521f6023c9bec01 (patch) | |
| tree | 3f870c04b3dce315bba1b21aa2da158494e71774 /packages/lib/auth.ts | |
| parent | Merge pull request #355 from supermemoryai/archive (diff) | |
| download | supermemory-39003aff23d64ff1d96074d71521f6023c9bec01.tar.xz supermemory-39003aff23d64ff1d96074d71521f6023c9bec01.zip | |
New Version of Supermemory Consumer App
Diffstat (limited to 'packages/lib/auth.ts')
| -rw-r--r-- | packages/lib/auth.ts | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/packages/lib/auth.ts b/packages/lib/auth.ts new file mode 100644 index 00000000..4369bef1 --- /dev/null +++ b/packages/lib/auth.ts @@ -0,0 +1,32 @@ +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", + throw: true, + }, + 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 |