Can I share client API routes across subdomains?

I have a monorepo setup and trying to use one app's API routes from another app. (For example, calling localhost:3000's routes from localhost:3001. In production, it will be calling app.domain.com's routes from admin.domain.com) I faced the cors error as expected in local development. Tried to fix it by adding mode: "no-cors":

createAuthClient({
    baseURL: [localhost:3000 | app.domain.com],
    plugins: [...],
    fetchOptions: {
      mode: "no-cors",
    },
  });

But it didn't work and still getting this error:
ERROR [Better Auth]: TypeError [TypeError: Cannot create property 'callbackURL' on string '{"provider":"github","callbackURL":"/"}']
Was this page helpful?