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

@mesob/auth-hono

v0.1.0

Published

Complete Identity and Access Management (IAM) system for Hono applications with type-safe APIs, OpenAPI documentation, and RPC client support.

Readme

@mesob/auth-hono

Complete Identity and Access Management (IAM) system for Hono applications with type-safe APIs, OpenAPI documentation, and RPC client support.

Features

  • 🔐 Complete Authentication: Sign up, sign in, sign out with email/phone
  • 👤 User Management: Profile updates, email/phone changes
  • 🔑 Password Management: Forgot, reset, change, verify
  • ✉️ Email Verification: Request and confirm email verification
  • 📱 Phone Verification: OTP-based phone verification
  • 🏢 Multi-Tenant Support: Tenant isolation with configurable setup
  • 👥 IAM System: Users, tenants, domains, roles, permissions management
  • 📚 OpenAPI Docs: Interactive API documentation with Scalar UI
  • 🔷 Type-Safe RPC: Generate type-safe clients for frontend
  • 🛡️ Type Safety: Full TypeScript support with Hono typed context

Quick Start

Installation

pnpm add @mesob/auth-hono

Basic Setup

import { mesobAuth } from '@mesob/auth-hono';

const auth = mesobAuth({
  connectionString: process.env.DATABASE_URL!,
  secret: process.env.AUTH_SECRET!,
  title: 'My App IAM API',
  docsTheme: 'saturn',
  enableTenant: true,
  session: {
    expiresIn: '30d',
    maxPerUser: 5,
  },
  email: {
    enabled: true,
    verificationRequired: true,
    verificationExpiresIn: '1h',
    resend: {
      apiKey: process.env.RESEND_API_KEY!,
      from: '[email protected]',
    },
  },
  phone: {
    enabled: true,
    verificationRequired: true,
    otpLength: 6,
    otpExpiresIn: '10m',
    smsConfig: {
      baseUrl: process.env.SMS_BASE_URL!,
      identifierId: process.env.SMS_IDENTIFIER_ID!,
      senderName: 'MyApp',
      apiKey: process.env.SMS_API_KEY!,
    },
  },
});

Integration

import { Hono } from 'hono';

const app = new Hono();

// Mount auth routes
app.route('/api/auth', auth.app);

// Or use as standalone handler
app.all('/api/auth/*', (c) => {
  return auth.handler.fetch(c.req.raw);
});

Access Session

app.use('*', async (c, next) => {
  const session = await auth.getSession(c);
  if (session.user) {
    c.set('user', session.user);
  }
  await next();
});

Access Documentation

After mounting routes, access:

  • /api/auth/docs - Interactive Scalar UI
  • /api/auth/openapi.json - OpenAPI specification

Type-Safe RPC Client

Generate type-safe clients for your frontend:

import { hc } from 'hono/client';
import type { MesobAuthApp } from '@mesob/auth-hono';

const authClient = hc<MesobAuthApp>('http://localhost:3000/api/auth', {
  init: {
    credentials: 'include', // Required for cookies
  },
});

// All API calls are fully type-safe
const user = await authClient.me.$get();
const result = await authClient['sign-in'].$post({
  json: { identifier: '[email protected]', password: 'password' },
});

Documentation

API Routes

Authentication

  • POST /sign-up - Sign up with email/phone
  • POST /sign-in - Sign in
  • POST /sign-out - Sign out
  • POST /check-user - Check if user exists

Profile

  • GET /me - Get current user
  • GET /session - Get current session
  • PUT /update - Update profile
  • PUT /update-email - Request email change
  • PUT /update-phone - Request phone change

Password

  • POST /password/forgot - Request password reset
  • POST /password/reset - Reset password
  • POST /password/verify - Verify password
  • PUT /password/change - Change password

Email Verification

  • POST /email/verification/request - Request verification code
  • POST /email/verification/confirm - Confirm verification

Phone Verification

  • POST /phone/verification/request - Request OTP
  • POST /phone/verification/confirm - Confirm OTP

IAM Management

  • GET /users - List users
  • GET /users/{id} - Get user
  • More IAM routes coming soon...

See routes.md for complete API reference.

Requirements

  • Node.js 22+
  • PostgreSQL database
  • pnpm (recommended) or npm

License

MIT