Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion docs/content/docs/framework-guides/expo.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -122,18 +122,21 @@ description: Install and configure Convex + Better Auth for Expo.
// The component client has methods needed for integrating Convex with Better Auth,
// as well as helper methods for general use.
export const authComponent = createClient<DataModel>(components.betterAuth);
// This is important: retrieve the HTTP actions url from environment variables
const siteUrl = process.env.CONVEX_SITE_URL || "";

export const createAuth = (
ctx: GenericCtx<DataModel>,
{ optionsOnly } = { optionsOnly: false },
) => {
return betterAuth({
baseUrl: siteUrl,
// disable logging when createAuth is called just to generate options.
// this is not required, but there's a lot of noise in logs without it.
logger: {
disabled: optionsOnly,
},
trustedOrigins: ["your-scheme://"],
trustedOrigins: ["your-scheme://", siteUrl],
database: authComponent.adapter(ctx),
// Configure simple, non-verified email/password to get started
emailAndPassword: {
Expand Down