Integrating with React, Vite, URQL
hey folks, im trying to intergrate Kinde auth with urql, and I'm running into some issues.
first off, here's the code:
I keep running into undefined errors, where the output of the
useKindeAuth
hook is undefined8 Replies
I've tried directly using the
getToken
and isAuthenticated
functions inside refreshAuth
, addAuthToOperation
and willAuthError
but I get the same undefined issueHey @space,
I can help you out.
Which Kinde SDK are you using?
react sdk!
might be related to https://discord.com/channels/1070212618549219328/1207085158080188438
okay, unless i explicitly check if
auth.isLoading
it will throw an undefined type error -
i dont think this is intended behavior? if it is, the typedef should capture thisHey @space,
I will get one of my React expert teammates to look into this for you.
Hi @space I am looking into this, I am trying to recreate your setup locally, if you are able to provide a minimal reproduction that would super helpful.
hey! sorry i missed this text, give me one sec
This should work as a minimal example, you just need to point it to a graphql server and fix the kinde auth config
this just tries to instantiate the graphql server without checking if auth.isLoading which should throw an undefined type error because
auth.getToken
is not defined