Correct way to make api request from server side
hii, i have my better auth setup on my hono backend, i have an monorepo with next js, and my auth file is on backend, and i have the authclient on frontend, my authentication is working fine, but i need to fetch data on server components, so I saw on docs that i need to use the getSession from auth file and pass in the headers from next js, but since my auth file is on backend, how i can do it? just import it from there? what is the correct way?
this is my current hono rpc client config, that works very good with client side fetching
import { hcWithType } from "@repo/api-client";
export const client = hcWithType("http://localhost:4000", {
init: {
credentials: "include",
},
});
0 Replies