karlupo
BABetter Auth
•Created by karlupo on 4/24/2025 in #help
Social signup for Expo App
Frontend:
import { createAuthClient } from "better-auth/react";
import { expoClient } from "@better-auth/expo/client";
import * as SecureStore from "expo-secure-store";
import api from "../services/axios";
import { usernameClient } from "better-auth/client/plugins"
export const authClient = createAuthClient({
baseURL: "http://dressr.at:4000/", /* base url of your Better Auth backend. /
plugins: [
expoClient({
scheme: "dressr",
storagePrefix: "dressr",
storage: SecureStore,
}),
usernameClient()
]
});
Backend:
import { betterAuth } from "better-auth";
import pool from "../config/database.js";
import { expo } from "@better-auth/expo";
import { username } from "better-auth/plugins"
export const auth = betterAuth({
database: pool,
emailAndPassword: {
enabled: true
},
plugins: [
expo(),
username()
],
socialProviders: {
google: {
clientId: process.env.GOOGLE_CLIENT_ID,
clientSecret: process.env.GOOGLE_CLIENT_SECRET
}
},
trustedOrigins: [""]
})
12 replies
BABetter Auth
•Created by karlupo on 4/24/2025 in #help
Social signup for Expo App
backend or frontend?
12 replies
BABetter Auth
•Created by karlupo on 4/24/2025 in #help
Social signup for Expo App
i already have my backend and domain deployed, only my frontend is running locally
12 replies
BABetter Auth
•Created by karlupo on 4/24/2025 in #help
Social signup for Expo App
im using redirect uri method
12 replies