npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@sfxcode/nuxt-mongocamp-server

v1.5.0

Published

Nuxt module wrapping a generated OpenAPI client for [MongoCamp](https://mongocamp.io), with composables for browser-session auth and server-side API-key/bearer auth.

Readme

Nuxt Mongocamp Module

Nuxt module wrapping a generated OpenAPI client for MongoCamp, with composables for browser-session auth and server-side API-key/bearer auth.

Setup

pnpm add @sfxcode/nuxt-mongocamp-server
// nuxt.config.ts
export default defineNuxtConfig({
  modules: ['@sfxcode/nuxt-mongocamp-server'],
  mongocamp: {
    url: process.env.MONGOCAMP_URL,
    apiKey: process.env.MONGOCAMP_API_KEY, // optional, used by server composables
    refreshToken: true,
    tokenRefreshInterval: 60000,
  },
})

Module options

| Option | Type | Default | Description | | ------------------------| --------- | ------- | ----------------------------------------------------------------------------------------------| | url | string | — | Required. Base URL of the MongoCamp server. | | apiKey | string | — | Optional. Stored server-side only; picked up automatically by useMongocampApi(event). | | paginationSize | number | 500 | Default rows per page for search/list composables. Values below 10 fall back to the default. | | refreshToken | boolean | — | Whether the client auto-refreshes the session token on an interval after login. | | tokenRefreshInterval | number | 5000 | Refresh interval in ms. Values below 5000 fall back to the default. |

A missing url throws during nuxi dev/nuxi build/nuxi generate (not during nuxi prepare, so IDE/type-stub generation still works without a configured backend).

Client composables (src/runtime/composables)

| Composable | Purpose | | ------------------------------------| ------------------------------------------------------------------------| | useMongocampApi() | Builds all 11 generated API clients, authenticated with the browser session token. | | useMongocampAuth() | Login/logout, isLoggedIn, userRoles/userGrants, and token-refresh lifecycle. | | useMongocampStorage() | The session cookie ({ token, profile }) backing auth state; SSR-safe. | | useMongocampUser() | Reactive current user profile. | | useMongocampUrl() | The configured base URL. | | useMongocampSearch() | find/findAll/findByField document search helpers. | | usePaginatedFind(collection, opts)| Reactive pagination wrapper (page, documents, pending, error, nextPage/previousPage/goToPage). | | useMongocampApiCollection(name) | Per-collection insert/update/delete/aggregate/schema helpers. | | useMongocampApiCollections() | List collections/databases, database info. | | useMongocampApiFiles() | Bucket and file upload/download/list helpers. | | useMongocampApiJobs() | List/register/update/execute/delete scheduled jobs. | | useMongocampApiAdmin() | User and role management. |

Server composables (src/runtime/server/composables)

| Composable | Purpose | | -----------------------------------------------| -----------------------------------------------------------------------------------| | useMongocampApi(event, token?) | Builds authenticated API clients using the module's apiKey, or the given token as a fallback. | | useMongocampServerApi(url, key?, token?) | Lower-level factory when you need to authenticate against a different URL/credential explicitly. |

// server/api/mongocamp/users.ts
export default defineEventHandler((event) => {
  const { adminApi } = useMongocampApi(event)
  return adminApi.listUsers()
})

Development

Setup

Install node:

Latest node LTS version required (24) Use node manager like nvm to install.

Install pnpm: https://pnpm.io/installation

Install dependencies:

pnpm install

Environment

Create .env file in playground with your MongoCamp Parameter for client authentication and API access.

MONGOCAMP_URL=
MONGOCAMP_ADMIN_USER=
MONGOCAMP_ADMIN_PASSWORD=
NITRO_MONGOCAMP_API_KEY=

Run

  • Run pnpm dev:prepare to generate type stubs.
  • Use pnpm dev to start playground in development mode.