Replies: 1 comment 2 replies
-
Is the issue happening in SSR or when running on the client? |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi community 👋
I've been using openpi-ts for a few days now and I love it! But I have come to a problem in my monorepo setup.
TL;DR
What would be the best approach to dynamically handle baseUrl (and maybe other options) per request?
I have monorepo with "api" package where I have generated client, sdk, ... with the default baseUrl. In one of my Next.js app I need to set baseUrl from header per request.
So I created runtimeConfig where I set config from the getter method.
And then in middleware.ts / root layout I'm updating getter method with a proper baseUrl.
Problem is that client is initialized with a default getter, so it will never use updated getter. What will be the best approach to handle this? I also tried to set baseUrl with .setConfig() but still no luck.
Beta Was this translation helpful? Give feedback.
All reactions