import { createTRPCProxyClient, httpBatchLink, loggerLink, } from '@trpc/client'; import { AppRouter } from "~/trpc/api/root"; import { getBaseUrl } from '~/utils/url'; // create the client, export it export const api = createTRPCProxyClient({ links: [ // will print out helpful logs when using client // loggerLink(), // identifies what url will handle trpc requests httpBatchLink({ url: `${getBaseUrl()}/api/trpc` }) ], });