appwrite / sdk-for-web

[READ-ONLY] Official Appwrite Web SDK 🧑

Home Page:https://appwrite.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

React Native / Expo support

brunoprietog opened this issue Β· 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