Sean Aguinaga
Sean Aguinaga2d ago

Expo Example?

Not sure how to do this part: https://www.better-auth.com/docs/integrations/expo#configure-a-better-auth-backend Since it doesn't need a context? but that is needed for the convex adapter?
Expo Integration | Better Auth
Integrate Better Auth with Expo.
6 Replies
Convex Bot
Convex Bot2d ago
Thanks for posting in <#1088161997662724167>. Reminder: If you have a Convex Pro account, use the Convex Dashboard to file support tickets. - Provide context: What are you trying to achieve, what is the end-user interaction, what are you seeing? (full error message, command output, etc.) - Use search.convex.dev to search Docs, Stack, and Discord all at once. - Additionally, you can post your questions in the Convex Community's <#1228095053885476985> channel to receive a response from AI. - Avoid tagging staff unless specifically instructed. Thank you!
Sean Aguinaga
Sean AguinagaOP18h ago
I am not sure where there are steps numbered out like that? https://convex-better-auth.netlify.app/#getting-started Not here?
Convex + Better Auth
Typesafe, secure auth for Convex apps with Better Auth
Sean Aguinaga
Sean AguinagaOP18h ago
Unfortuantely I do not understand how to do what you are asking
Sean Aguinaga
Sean AguinagaOP18h ago
https://convex-better-auth.netlify.app/#getting-started Even after following this How would you get the ctx?
Convex + Better Auth
Typesafe, secure auth for Convex apps with Better Auth
Sean Aguinaga
Sean AguinagaOP18h ago
import { convexAdapter } from "@convex-dev/better-auth";
import { convex, crossDomain } from "@convex-dev/better-auth/plugins";
import { requireEnv } from "@convex-dev/better-auth/utils";
import { betterAuth } from "better-auth";
import { betterAuthComponent } from "../../convex/auth";
import { type GenericCtx } from "../../convex/_generated/server";

const siteUrl = requireEnv("SITE_URL");

export const createAuth = (ctx: GenericCtx) =>
// Configure your Better Auth instance here
betterAuth({
trustedOrigins: [siteUrl],
database: convexAdapter(ctx, betterAuthComponent),

// Simple non-verified email/password to get started
emailAndPassword: {
enabled: true,
requireEmailVerification: false,
},
plugins: [
// The Convex plugin is required
convex(),

// The cross domain plugin is required for client side frameworks
crossDomain({
siteUrl,
}),
],
});
import { convexAdapter } from "@convex-dev/better-auth";
import { convex, crossDomain } from "@convex-dev/better-auth/plugins";
import { requireEnv } from "@convex-dev/better-auth/utils";
import { betterAuth } from "better-auth";
import { betterAuthComponent } from "../../convex/auth";
import { type GenericCtx } from "../../convex/_generated/server";

const siteUrl = requireEnv("SITE_URL");

export const createAuth = (ctx: GenericCtx) =>
// Configure your Better Auth instance here
betterAuth({
trustedOrigins: [siteUrl],
database: convexAdapter(ctx, betterAuthComponent),

// Simple non-verified email/password to get started
emailAndPassword: {
enabled: true,
requireEmailVerification: false,
},
plugins: [
// The Convex plugin is required
convex(),

// The cross domain plugin is required for client side frameworks
crossDomain({
siteUrl,
}),
],
});

Did you find this page helpful?