appwrite/sdk-for-web

React Native / Expo support

brunoprietog opened this issue ยท 3 comments

๐Ÿ”– Feature description

Hello!
Can this sdk be used with React Native? I was thinking that things like authentication with oauth providers would not work.
Thanks!

๐ŸŽค Pitch

Perhaps some alternative methods could be implemented for executions in these environments.

๐Ÿ‘€ Have you spent some time to check if this issue has been raised before?

  • I checked and didn't find similar issue

๐Ÿข Have you read the Code of Conduct?

As react native does not have window.localstorage, implementing the same with
AsyncStorage from '@react-native-async-storage/async-storage'; would be more sense.

i was checking the docs of supabase. This is how they did it

import AsyncStorage from '@react-native-async-storage/async-storage';
import { createClient } from '@supabase/supabase-js'

const supabaseUrl = YOUR_REACT_NATIVE_SUPABASE_URL
const supabaseAnonKey = YOUR_REACT_NATIVE_SUPABASE_ANON_KEY

export const supabase = createClient(supabaseUrl, supabaseAnonKey, {
  localStorage: AsyncStorage as any,
  autoRefreshToken: true,
  persistSession: true,
  detectSessionInUrl: false,
});

implementing something like this would be helpful

@brunoprietog, cookies should work automatically in react native. Would you be able to verify if oauth doesn't work in react native?

Closing in favor of some of the other React Native issues