@drmhse/authos-node
v0.1.8
Published
Node.js server adapter for AuthOS authentication - Express middleware and token verification
Maintainers
Readme
@drmhse/authos-node
Node.js adapter for AuthOS with token verification and Express middleware helpers.
Full documentation: authos.dev/docs/packages/authos-node/
AI agent skills: authos.dev/docs/ai-agent-skills/ and github.com/drmhse/authos_skill
Install
npm install @drmhse/authos-nodeFor Express middleware:
npm install @drmhse/authos-node expressQuick start
import express from 'express';
import { createAuthMiddleware } from '@drmhse/authos-node/express';
const app = express();
const { requireAuth, requirePermission } = createAuthMiddleware({
baseURL: 'https://sso.example.com',
});
app.get('/profile', requireAuth(), (req, res) => {
res.json({ user: req.auth?.claims });
});
app.delete(
'/users/:id',
requireAuth(),
requirePermission('users:delete'),
(req, res) => {
res.json({ ok: true });
},
);Context helpers
Use the middleware that matches the JWT context you issue:
requirePlatformOwner()requireOrganization(...)requireService(...)requireTenant(org, service)
See the docs site for verifier APIs, webhook helpers, and TypeScript details.
