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

@kshitijashitole/auth-server

v1.1.0

Published

Express API server with Prisma auth, analytics, and related routes — mount in your host app or run standalone.

Downloads

203

Readme

@kshitijashitole/auth-server

Express + Prisma API from this monorepo’s backend app: /auth, /analytics, /secure-auth.

Install

npm install @kshitijashitole/auth-server

Requires PostgreSQL. Copy .env with DATABASE_URL next to prisma.config.ts (project / package root), then generate the client:

npm run db:generate

(postinstall does not run prisma generate, so installs work without a database URL; CI and first-time setup should run db:generate explicitly.)

Environment

  • DATABASE_URL — PostgreSQL connection string
  • JWT_ACCESS_SECRET or JWT_SECRET — access tokens
  • JWT_REFRESH_SECRET — if your token helpers expect it (see src/utils/generateToken.js)
  • SMTP_* / SMTP_USER / SMTP_PASS — for OTP email
  • FRONTEND_URL / CORS_ORIGINS — browser clients
  • Admin analytics lists (recommended for production):
    • FAST_AUTH_ADMIN_SECRET — send x-admin-token: <secret> (or Authorization: Bearer <secret>) for GET /analytics/auth/events and GET /analytics/auth/users
    • FAST_AUTH_ADMIN_EMAILS — comma-separated emails allowed to call those endpoints with a normal user JWT

Use in your own Express app

import express from "express";
import authServerApp from "@kshitijashitole/auth-server";

const app = express();
app.use("/api", authServerApp); // APIs live under /api/auth, /api/analytics, …
app.listen(3000);

Paths are absolute on the mounted app (/auth, not /api/auth), so mount at / or use a gateway that strips the prefix — Express sub-app mounting may still expose routes at /auth relative to the child app. Test with app.use(authServerApp) at root or adjust your reverse proxy.

Run standalone

From the package root (after DATABASE_URL is set):

npm start

Checklist (local or production)

  1. .env with DATABASE_URL (see .env.example).
  2. npm install then npm run db:generate.
  3. Apply schema: npx prisma migrate deploy (or db:migrate in dev).
  4. Set JWT, SMTP, CORS, and optionally FAST_AUTH_ADMIN_SECRET / FAST_AUTH_ADMIN_EMAILS.
  5. npm start or mount the exported app in your host.

Publishing (maintainers)

Canonical code lives in ../backend. From this folder:

npm install
npm run db:generate   # needs DATABASE_URL in .env
npm publish --access public

prepublishOnly runs sync from ../backend then prisma generate. Ensure backend is a sibling of auth-server.