Replies: 1 comment
-
You can provide a custom fetch implementation shown here and extend the headers array. So like the following: import { createClient, FetchTransport } from "@rspc/client";
import type { Procedures } from "./bindings.ts"; // The bindings exported from your Rust code!
const client = createClient<Procedures>({
transport: new FetchTransport(
"http://localhost:4000/rspc",
// Include Cookies for cross-origin requests
(input, init) => fetch(input, { ...init, headers: { ...init.headers, "X-Demo": "123" })
),
}); In a future update, I will probs add a nicer way to do this because forgetting to pass through the |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am going through https://www.rspc.dev/client but I do not see a way to send custom headers in the request. For example, if I wish to send a
Bearer <token>
in the request.Beta Was this translation helpful? Give feedback.
All reactions