© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•3y ago•
3 replies
mtjka

React Native + Expo + Supabase Auth

Hi all,

I was trying to use rn+expo and implement supabase Authentication but when I add the call to get session:

useEffect(() => {
db.auth.getSession().then(({ data: { session } }) => {
setSession(session)
})

db.auth.onAuthStateChange((_event, session) => {
setSession(session)
})
}, [])

I get the error message "window is not defined". This only happens on Web dev build, on Android it works fine
image.png
Supabase banner
SupabaseJoin
Supabase gives you the tools, documentation, and community that makes managing databases, authentication, and backend infrastructure a lot less overwhelming.
45,816Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Authentication/React Native Expo
SupabaseSSupabase / help-and-questions
14mo ago
Supabase Auth with Apple Oauth and Expo -> React Native
SupabaseSSupabase / help-and-questions
9mo ago
React Native Expo Supabase Realtime Issues
SupabaseSSupabase / help-and-questions
14mo ago
Auth with React Native (without Expo)?
SupabaseSSupabase / help-and-questions
16mo ago