// client.ts
import { createTRPCProxyClient, httpBatchLink } from "@trpc/client";
import type { AppRouter } from "wherever";
export const trpcClient = createTRPCProxyClient<AppRouter>({
links: [
httpBatchLink({
url: `whatever`,
// You can pass any HTTP headers you wish here
async headers() {
return {
authorization: "whatever",
};
},
}),
],
});
// client.ts
import { createTRPCProxyClient, httpBatchLink } from "@trpc/client";
import type { AppRouter } from "wherever";
export const trpcClient = createTRPCProxyClient<AppRouter>({
links: [
httpBatchLink({
url: `whatever`,
// You can pass any HTTP headers you wish here
async headers() {
return {
authorization: "whatever",
};
},
}),
],
});