useMongocampClientApi
The mode-switching indirection every other composable/component in this module calls instead of @sfxcode/nuxt-mongocamp-server's useMongocampApi() directly — a drop-in with the exact same return shape.
ts
const { adminApi, documentApi, collectionApi, /* ... */ } = useMongocampClientApi()What it does
Reads useServerProxy from nuxtUiMongocamp (via useRuntimeConfig().public.nuxtUiMongocampOptions) and returns:
useMongocampApi()(the dependency's browser-session client) whenuseServerProxyisfalse— the default.useMongocampProxyApi()(this module's local-proxy client) whenuseServerProxyistrue.
See Server Proxy Auth for the full picture — what proxy mode is for, how to enable it, and how to guard it. You won't normally call useMongocampClientApi directly: it exists so that MongocampUsers, MongocampCollections, useMongocampAdmin, and every other built-in composable/component keep working unmodified in either mode.
Related
useMongocampProxyApi— the proxy-mode branch- Server Proxy Auth — the full guide