()
| 151 | |
| 152 | // For direct usage, these call the getters |
| 153 | export const getAPIUrl = () => { |
| 154 | // On custom domains (client-side), use relative path to go through Next.js proxy |
| 155 | // This ensures cookies work correctly (same-origin) |
| 156 | if (isOnCustomDomain()) { |
| 157 | return '/api/v1/' |
| 158 | } |
| 159 | return deriveAPIUrl() |
| 160 | } |
| 161 | |
| 162 | // Server-side only - always returns full URL (never relative path) |
| 163 | // Use this in Server Components, API routes, and server-side data fetching |
no test coverage detected