> can I connect both to convex and share
can I connect both to convex and share stuff like auth?There are kinda two questions here: 1. Sharing "stuff" (i.e. Convex functions and data) - Yes, these can be shared with multiple apps using Turborepo's packages. There are a few threads in #support-community where you can probably find guidance to help with this. 2. Sharing auth - I'm no auth expert, but I don't think this is possible. I've only used Clerk, and it requires a unique redirect URI for the end of the auth flow. Even dev and prod versions of the same app need separate Clerk config. (Again, very little experience with auth; open to correction if I'm off the mark)
2 Replies
cc/ @Rodrigo Santos if you're using clerk, subdomain auth is supposed to just work: https://clerk.com/docs/deployments/overview#authentication-across-subdomains
As a reference, some of the official templates share a single convex backend with multiple apps, eg https://github.com/get-convex/turbo-expo-nextjs-clerk-convex-monorepo/tree/main
It might depend on how subdomains are set up. In my situation with work, our primary domain is just the public company website. A specific subdomain is being used for a staff portal, and that has its own Clerk auth (with separate dev and prod deployments). There will be other subdomains in the future, some with separate auth configurations. Because of all this, sharing likely wouldn't work in our case.
Then again we're using this specific design because of the varying auth needs in each case, so this might not actually contribute anything useful to the discussion.
We now return you to your regularly-scheduled Friday.