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.
14 Replies
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!
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
Unfortuantely I do not understand how to do what you are asking
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
Ah sorry, I updated that comment with a link for clarity - I meant the Better Auth docs, starting with step 4 here: https://www.better-auth.com/docs/integrations/expo#add-the-expo-plugin-on-your-server
Gotcha!
I don't need the api route part then?
https://www.better-auth.com/docs/integrations/expo#configure-a-better-auth-backend
Expo Integration | Better Auth
Integrate Better Auth with Expo.
No, not necessary
Does that mean I can't use convex/better-auth in their RSC/server-side components then?
No, it just means I haven't tried 🙈
If you're using Convex, though, I'd really recommend just using Convex functions, and if you really need request/response for some reason, http actions for server side code. Projects that don't use Convex have something to gain from Expo api routes, but I suspect it's just added complexity for a Convex project. This is different from web where you probably have a server anyway with a Nextjs or TanStack site for SSR, so framework server actions and functions can come into play organically. Your native app won't need SSR, so Expo api routes is just an additional server you host that you have to get working with Convex, which is already your server.
If anyone feels I'm missing a use case here please point it out. Probably need compatibility regardless for folks migrating to Convex that have already built on Expo api routes.
It basically lets you do RSC with native components its super sick
Expo Documentation
Using React Server Components in Expo Router apps
Learn about rendering React components on the server in Expo.
I think this would work for the expo api routes too?
