usePrivateQuery to access a private API, for example to get the current user info.
API requests
usePrivateQuery
Hook to fetch data from authenticated private API endpoints.
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Hook to fetch data from authenticated private API endpoints.
usePrivateQuery to access a private API, for example to get the current user info.
const { data, isLoading, error } = usePrivateQuery("/v1/client/info");
const { state } = useAccount();
if (isLoading) return <div>loading...</div>;
return (
<div>
<div>{state.status}</div>
<pre>{JSON.stringify(data, null, 2)}</pre>
</div>
);