mirror of
https://github.com/ajnart/homarr.git
synced 2026-01-30 03:09:19 +01:00
20 lines
534 B
TypeScript
20 lines
534 B
TypeScript
"use client";
|
|
|
|
import { createTRPCClient, httpLink } from "@trpc/client";
|
|
import { createTRPCReact } from "@trpc/react-query";
|
|
import SuperJSON from "superjson";
|
|
|
|
import type { AppRouter } from ".";
|
|
import { createHeadersCallbackForSource, getTrpcUrl } from "./shared";
|
|
|
|
export const clientApi = createTRPCReact<AppRouter>();
|
|
export const fetchApi = createTRPCClient<AppRouter>({
|
|
links: [
|
|
httpLink({
|
|
url: getTrpcUrl(),
|
|
transformer: SuperJSON,
|
|
headers: createHeadersCallbackForSource("fetch"),
|
|
}),
|
|
],
|
|
});
|