Keypoint-based authentication
Validate a caller identity, expiration, protocol, and configured origin before your route handles the request.
Authentication guide →API SECURITY FRAMEWORK NODE.JS
Authentication and authorization for Node.js APIs, with a request lifecycle you can understand, configure, and extend.
npm install keypointjsNode.js 18+ · ESM package · Optional HTML parser
import { KeypointJS } from 'keypointjs';const api = new KeypointJS();await api.createKeypoint({ keyId: 'service-client', scopes: ['orders:read'], protocols: ['https']});api.get('/v1/orders', (ctx) => { if (!ctx.hasScope('orders:read')) { return ctx.status(403); } return ctx.json({ orders: [] });});A CLEAR SECURITY FOUNDATION
Purposeful primitives for request identity and access decisions, without asking you to replace your whole stack.
Validate a caller identity, expiration, protocol, and configured origin before your route handles the request.
Authentication guide →Express permissions directly, and resolve registered parent-to-child scope relationships.
Scope system →Evaluate method, origin, IP, time, scope, protocol, and rate rules along the request path.
Policy engine →Extend request processing with middleware, lifecycle hooks, and purpose-built plugins.
Plugin system →Parse HTML and query a supported selector subset through an optional package subpath.
HTML Parser →WHY KEYPOINTJS
Keep identity, authorization, routing, and extension points close to the request—visible in one framework flow.
Understand the lifecycle →See the middleware stages and decide where policy belongs.
Use the built-in router or integrate the request pipeline with your application.
Know which controls are implemented and which still need application-level work.
UNDER THE HOOD
The framework composes these stages in order. CORS and keypoint validation are conditional; the core middleware sequence remains inspectable.
BUILT WITH CARE
Security is a system property. KeyPointJS offers building blocks; your configuration and deployment still matter.
Read security guidance →Reject missing, unknown, or expired keypoints in the request validator.
Check endpoint permissions through context-aware scope inheritance.
Secret headers are optional today; empty origin allowlists allow any origin. Review the current behavior.
Per-keypoint allowed IPs are not enforced by the validator. Read the security notes before deployment.
A SMALL, REAL EXAMPLE
Install from npm, issue an identity, then check permission where the resource is served.
Build your first API →import { KeypointJS } from 'keypointjs';
const api = new KeypointJS();
await api.createKeypoint({
keyId: 'client-a',
scopes: ['orders:read'],
protocols: ['https']
});
api.get('/orders', (ctx) => {
if (!ctx.hasScope('orders:read')) {
return ctx.status(403);
}
return ctx.json({ orders: [] });
});
await api.listen(3000, '127.0.0.1');PACKAGE SOURCE
Version verified against package.json in the linked repository. Review the published package and release history before upgrading.
OPEN SOURCE, BUILT IN THE OPEN
Explore the implementation, open an issue, or help improve the project.