Skip to content

useMongocampProxyApi

Client-side drop-in for @sfxcode/nuxt-mongocamp-server's useMongocampApi() — same returned shape (adminApi, documentApi, collectionApi, fileApi, …), but every API instance is pointed at this module's local proxy route instead of the real MongoCamp URL.

ts
const { adminApi, documentApi, /* ... */ } = useMongocampProxyApi()

No token or api key is set client-side — auth is injected entirely server-side by the proxy route (see Server Proxy Auth). The base path comes from serverProxyPath (nuxtUiMongocamp config, default /api/_mongocamp).

You won't normally call this directly — useMongocampClientApi picks between this and the session-mode client automatically based on useServerProxy, and every built-in composable/component already goes through that instead.

Released under the MIT License.