const query = process.env.VERCEL_SKEW_PROTECTION_ENABLED === '1' ? `?dpl=${process.env.VERCEL_DEPLOYMENT_ID}` : ''; const res = await fetch(`/get${query}`);
const [trpcClient] = useState(() => api.createClient({ links: [ loggerLink({ enabled: (op) => env.NODE_ENV === 'development' || (op.direction === 'down' && op.result instanceof Error), }), unstable_httpBatchStreamLink({ transformer: SuperJSON, url: `${getBaseUrl()}/new-api/trpc`, headers() { const headers = new Headers(); headers.set('x-trpc-source', 'nextjs-react'); return headers; }, }), ], }), );