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

auth-cms

v0.1.0

Published

Nuxt 3 module for OAuth 2.0 client management and social login (Google, Line)

Readme

auth-cms

Nuxt 3 module for OAuth 2.0 client management and Social Login (Google, Line)

Features

  • OAuth 2.0 Client CRUD management
  • Social Login configuration (Google, Line)
  • OAuth consent/authorize screen
  • Auth composables (login, logout, user state, MFA verification)
  • Auth route middleware
  • Auto-initialized auth state via Nuxt plugin
  • Fully typed with TypeScript

Installation

npm i auth-cms

Setup

Add to your nuxt.config.ts:

export default defineNuxtConfig({
  modules: ['auth-cms'],

  authCms: {
    baseURL: '/api',              // API base path (default: '/api')
    tokenKey: '_my_info_',         // localStorage key for token (default: '_my_info_')
    tokenExpiryKey: '_token_expiry_', // localStorage key for expiry
    apiKey: '',                    // x-api-key header value (if needed)
    loginPath: '/login',           // redirect path when unauthenticated
    homePath: '/',                 // redirect path after login
  },
})

Usage

Auth Middleware

Protect routes by adding middleware:

// pages/admin.vue
definePageMeta({
  middleware: 'auth-cms',
})

Auth Composable

<script setup lang="ts">
const { user, isAuthenticated, login, logout, fetchUser } = useAuth()

async function handleLogin() {
  const res = await login('username', 'password')
  if (res.mfaRequired) {
    // Show OTP input, then call verifyMfa
    await verifyMfa(res.mfaToken, '123456')
  }
  await fetchUser()
}
</script>

OAuth Clients Manager Component

The OAuthClientsManager component provides the full CRUD UI with search, stats, and social login config.

<template>
  <AuthCmsOAuthClientsManager @success="onSuccess" @error="onError" />
</template>

<script setup lang="ts">
function onSuccess(msg: string) { console.log(msg) }
function onError(msg: string) { console.error(msg) }
</script>

Social Login Config Component

<template>
  <AuthCmsSocialLoginConfig @success="onSuccess" @error="onError" />
</template>

OAuth Authorize Screen

<template>
  <AuthCmsOAuthAuthorize />
</template>

API Endpoints Expected

The module expects these backend endpoints (under baseURL):

| Method | Endpoint | Purpose | |--------|----------|---------| | POST | /auth/login | Login | | POST | /mfa/verify-login | MFA OTP verification | | GET | /user/data | Fetch current user | | GET | /oauth/clients | List OAuth clients | | POST | /oauth/clients | Create client | | PUT | /oauth/clients/:id | Update client | | DELETE | /oauth/clients/:id | Delete client | | POST | /oauth/clients/:id/regenerate-secret | Regenerate secret | | GET | /oauth/social/config | Get social config | | PUT | /oauth/social/config/google | Save Google config | | PUT | /oauth/social/config/line | Save Line config | | POST | /oauth/authorize/consent | Submit consent |

Requirements

  • Nuxt 3.15+
  • Tailwind CSS (for component styling)