#Anyone was able to make latest Qwik+Supabase work?

15 messages · Page 1 of 1 (latest)

sage elbow
acoustic shoal
#

Could you give me a bit more detail on the error, I'm implementing this is the next couple of days so it might be helpful. In case I make it work I'll share the solution

sage elbow
#

So when add

const supabaseClient = createServerClient(
    import.meta.env.PUBLIC_SUPABASE_URL,
    import.meta.env.PUBLIC_SUPABASE_ANON_KEY,
    requestEv
  );

according to the docs ^

We get the TS error:

Argument of type 'RequestEventLoader<QwikCityPlatform>' is not assignable to parameter of type 'RequestEvent<QwikCityPlatform>'.
  Type 'RequestEventLoader<QwikCityPlatform>' is missing the following properties from type 'RequestEvent<QwikCityPlatform>': headersSent, exited, getWritableStream, next
sage elbow
#

I did got it working, just using:

const supabaseClient = createClient(
    import.meta.env.PUBLIC_SUPABASE_URL,
    import.meta.env.PUBLIC_SUPABASE_ANON_KEY
  );

But I'm not sure if this is the correct approach.

acoustic shoal
#

what is the requestEv doing exactly? Because for most client libraries (I am imagining using google apis for example), you would only need to get credentials instantiated to make it work

#

also I don't why this library (supabase-auth-helpers-qwik') would be needed ; in the end it's just javascript

#

if you are doing the same as the native javascript implementation I wouldn't bother to add the qwik helper library

#

unless qwik helper is solving a specific problem

acoustic shoal
#

I actually just made it work using only the "createClient" method in '@supabase/supabase-js", I actually only had issues with import.meta.env.PUBLIC_SUPABASE_URL

#

as putting my env variables inside .env.local is making it return undefined

#

although the dev server tracks changes inside .env.local

acoustic shoal
sage elbow
#

Weird. I was deploying on Vercel, so PUBLIC_ worked for me.

acoustic shoal