DINOD
tRPC2y ago
1 reply
DINO

Is to possible to update the trpc client url?

Hello,

I have create my trpc client this way:

trpcClientZS = trpcReactZS.createClient({
    links: [
      httpBatchLink({
        url: `http://192.168.1.2:3000/trpc`,
        fetch(url, options) {
          return fetch(url, {
            ...options,
            credentials: 'include'
          })
        },
      })
    ],
    transformer: SuperJSON
  })

Is there a way i can change the url in the httpBatchLink when the app is running? I tried to create and override the old instance but it didn't work.

Thanks.
Was this page helpful?