Something went wrong. Try again.
A self-hosted web platform for applications & services with design based on Google's Material 3 Expressive. (Work In Progress)
Something went wrong. Try again.
12345678910111213141516171819202122232425import { createTRPCClient, httpBatchLink, httpSubscriptionLink, splitLink } from "@trpc/client";import type { TRPCRouter } from "../../backend/index";
const trpc = createTRPCClient<TRPCRouter>({ links: [ splitLink({ condition: (op: { type: string }) => op.type === "subscription", true: httpSubscriptionLink({ url: `${window.location.origin}/api/app/uk.ewsgit.console`, eventSourceOptions: { withCredentials: true, }, }), false: httpBatchLink({ url: `${window.location.origin}/api/app/uk.ewsgit.console`, fetch(input, init) { return fetch(input, { credentials: "include", ...init }); }, }), }), ],});
export default trpc;