{"id":18592,"library":"navojit-auth","title":"Navojit Auth","description":"Navojit Auth v4.0.0 is a TypeScript-first universal authentication engine supporting Passkeys, Fastify, Mongoose, Drizzle ORM, and cross-language sync. It provides a unified auth layer for Node.js backends with built-in multi-tenancy. Peer dependencies include fastify >=4.0.0, mongoose >=8.0.0, drizzle-orm >=0.30.0, and postgres >=3.4.0. Differentiators: passkey-first design, multi-tenant by default, and cross-language session sync.","status":"active","version":"4.0.0","language":"javascript","source_language":"en","source_url":null,"tags":["javascript","fastify","auth","drizzle","mongoose","mongodb","multi-tenant","universal-auth","passkeys","typescript"],"install":[{"cmd":"npm install navojit-auth","lang":"bash","label":"npm"},{"cmd":"yarn add navojit-auth","lang":"bash","label":"yarn"},{"cmd":"pnpm add navojit-auth","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Required for Drizzle ORM integration","package":"drizzle-orm","optional":true},{"reason":"Required for Fastify plugin integration","package":"fastify","optional":true},{"reason":"Required for Mongoose integration","package":"mongoose","optional":true},{"reason":"Required for PostgreSQL native integration","package":"postgres","optional":true}],"imports":[{"note":"ESM-only since v4. CommonJS require will fail.","wrong":"const NavojitAuth = require('navojit-auth')","symbol":"NavojitAuth","correct":"import { NavojitAuth } from 'navojit-auth'"},{"note":"AuthPayload is a TypeScript type, use `import type` for runtime safety.","wrong":"import { AuthPayload } from 'navojit-auth'","symbol":"AuthPayload","correct":"import type { AuthPayload } from 'navojit-auth'"},{"note":"Fastify plugin is exported from a subpath `navojit-auth/fastify`.","wrong":"import { fastifyAuth } from 'navojit-auth'","symbol":"fastifyAuth","correct":"import { fastifyAuth } from 'navojit-auth/fastify'"}],"quickstart":{"code":"import { NavojitAuth } from 'navojit-auth';\nconst auth = new NavojitAuth({\n  providers: {\n    passkey: { rpID: 'localhost', origin: 'http://localhost:3000' },\n  },\n  session: { secret: process.env.SESSION_SECRET ?? 'change-me' },\n});\n// Generate passkey registration options\nconst options = await auth.generateRegistrationOptions({ userId: 'user123' });\nconsole.log('Registration options:', options);","lang":"typescript","description":"Initializes NavojitAuth with passkey provider and generates registration options."},"warnings":[{"fix":"Use `import` syntax or update to ESM.","message":"ESM-only since v4. CommonJS `require()` will not work.","severity":"breaking","affected_versions":">=4.0.0"},{"fix":"Install mongoose v8 or later.","message":"Peer dependency `mongoose >=8.0.0` is required if using Mongoose integration.","severity":"breaking","affected_versions":">=4.0.0"},{"fix":"Set `rpID` (e.g., 'localhost') and `origin` (e.g., 'http://localhost:3000').","message":"Passkey provider requires `rpID` and `origin` to be configured.","severity":"breaking","affected_versions":">=4.0.0"},{"fix":"Set `session.secret` to a string of length >= 32.","message":"Session secret must be at least 32 characters long.","severity":"gotcha","affected_versions":">=4.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Install the package: `npm install navojit-auth` and ensure `type: 'module'` in package.json.","cause":"Package not installed or ESM-only usage in CJS project.","error":"Cannot find module 'navojit-auth' or its corresponding type declarations."},{"fix":"Change to ESM import: `import { NavojitAuth } from 'navojit-auth'`.","cause":"Incorrect import using CommonJS `require` in v4.","error":"TypeError: NavojitAuth is not a constructor"},{"fix":"Install mongoose v8+: `npm install mongoose@8`.","cause":"Mongoose not installed or version too low.","error":"Missing required peer dependency: mongoose@>=8.0.0"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}