Most teams building a web + mobile product end up with two auth integrations that slowly drift apart. You don't need that. Here's how to run a single Supabase auth layer across a Next.js web app and an Expo mobile app in a monorepo — including the gotchas nobody warns you about.

1. Keep the Supabase client framework-agnostic

Depend only on @supabase/supabase-js. Expose a factory that takes the storage adapter as an argument:

export function createSupabaseClient({ url, anonKey, storage, detectSessionInUrl }) {

return createClient(url, anonKey, {