Per-request config — mobile vs web
Mobile sends Bearer, web sends cookie — one backend, both clients.
Use resolveConfig to override module options per request based on a header or origin.
How the client signals platform
Or pass the header directly via httpAdapter:
Why not just two backends
You could deploy api-mobile.example.com and api-web.example.com with different configs. That's clean but operationally heavier — two deploys, two monitoring stacks. resolveConfig is the lighter option for "minor differences only."
If the differences grow large (different auth methods, different MFA policies), splitting into two configs at module load is cleaner than one giant resolveConfig.
Related
- Hooks Reference —
resolveConfig. - Sessions & Tokens — header vs cookie modes.