sdk-for-web icon indicating copy to clipboard operation
sdk-for-web copied to clipboard

React Native / Expo support

Open brunoprietog opened this issue 4 years ago โ€ข 2 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?

  • [X] I checked and didn't find similar issue

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

brunoprietog avatar Nov 04 '21 03:11 brunoprietog

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

roo12312 avatar Jul 07 '22 02:07 roo12312

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

stnguyen90 avatar Sep 21 '22 17:09 stnguyen90

Closing in favor of some of the other React Native issues

stnguyen90 avatar Nov 10 '22 14:11 stnguyen90