diff --git a/apps/cli/templates/api/orpc/web/react/base/src/utils/orpc.ts.hbs b/apps/cli/templates/api/orpc/web/react/base/src/utils/orpc.ts.hbs index 7d735f5..4060212 100644 --- a/apps/cli/templates/api/orpc/web/react/base/src/utils/orpc.ts.hbs +++ b/apps/cli/templates/api/orpc/web/react/base/src/utils/orpc.ts.hbs @@ -33,6 +33,16 @@ export const link = new RPCLink({ credentials: "include", }); }, + {{#if (includes frontend "next")}} + headers: async () => { + if (typeof window !== "undefined") { + return {} + } + + const { headers } = await import("next/headers") + return Object.fromEntries(await headers()) + }, + {{/if}} {{/if}} });