mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-04-24 23:19:39 -05:00
13 lines
493 B
TypeScript
13 lines
493 B
TypeScript
import { createTRPCClient } from "@trpc/client";
|
|
import type { inferProcedureOutput } from "@trpc/server";
|
|
import type { AppRouter } from "../server";
|
|
|
|
export const trpcClient = createTRPCClient<AppRouter>({
|
|
url: `${import.meta.env.VITE_BACKEND_URL}/trpc`,
|
|
fetch: (input, init) => fetch(input, { ...init, credentials: "include" }),
|
|
});
|
|
|
|
export type InferQueryOutput<
|
|
TRouteKey extends keyof AppRouter["_def"]["queries"]
|
|
> = inferProcedureOutput<AppRouter["_def"]["queries"][TRouteKey]>;
|