22 lines
744 B
TypeScript
22 lines
744 B
TypeScript
import { expoClient } from "@better-auth/expo/client";
|
|
import { env } from "@code/env/native";
|
|
import { convexClient, crossDomainClient } from "@convex-dev/better-auth/client/plugins";
|
|
import { createAuthClient } from "better-auth/react";
|
|
import Constants from "expo-constants";
|
|
import * as SecureStore from "expo-secure-store";
|
|
import { Platform } from "react-native";
|
|
|
|
export const authClient = createAuthClient({
|
|
baseURL: env.EXPO_PUBLIC_CONVEX_SITE_URL,
|
|
plugins: [
|
|
convexClient(),
|
|
Platform.OS === "web"
|
|
? crossDomainClient()
|
|
: expoClient({
|
|
scheme: Constants.expoConfig?.scheme as string,
|
|
storagePrefix: Constants.expoConfig?.scheme as string,
|
|
storage: SecureStore,
|
|
}),
|
|
],
|
|
});
|