Dynamically setting baseURL
Hello, I'm currently building an expo application where the user can set the location of their local server. The issue I'm running into is trying to dynamically set the baseUrl based on what the user enters. I was trying the create a function to initialize the client route, but I've been struggling to get the typings correct with my plugins (expoClient and usernameClient).
4 Replies
causes
getAuth().getCookie()
and getAuth().signIn.username()
to both return a type error since they are methods the plugins add to the client.
well I'm realize that doesn't work anyways because whenever I first called getAuth()
(in my root layout) it then initializes the client with an empty string, since the user hasn't inputted it yet
are there any recommendations on how to approach this?I'm getting the same error. It's happening without dynamic parameters and only the expoClient plugin too
@entropy any progress here?
https://discord.com/channels/1288403910284935179/1343449075722227774/1343449075722227774
I fixed it. Had multiple versions of better fetch installed @entropy
Thanks for the help! Sadly it does really help with my core issue but I still appreciate it.
@entropy The problem would be your setting the type to a blank instance of createAuthClient
let client: ReturnType<typeof createAuthClient> | undefined
the client type would be equivalent to