Repository version v1.3.0

API SECURITY FRAMEWORK NODE.JS

Secure your APIs.
Own your request pipeline.

Authentication and authorization for Node.js APIs, with a request lifecycle you can understand, configure, and extend.

npm install keypointjs

Node.js 18+ · ESM package · Optional HTML parser

api.js keypointjs
01import { KeypointJS } from 'keypointjs';
02
03const api = new KeypointJS();
04
05await api.createKeypoint({
06 keyId: 'service-client',
07 scopes: ['orders:read'],
08 protocols: ['https']
09});
10
11api.get('/v1/orders', (ctx) => {
12 if (!ctx.hasScope('orders:read')) {
13 return ctx.status(403);
14 }
15 return ctx.json({ orders: [] });
16});
Request pipeline readyJavaScript  ·  ESM
✓Identity checkedKeypoint validated
↗Least privilegeorders:read
BUILT FOR DEVELOPERS WHO CARE ABOUT THE DETAILS
Authentication Authorization Extensible pipeline

A CLEAR SECURITY FOUNDATION

Security controls that fit
the way you build.

Purposeful primitives for request identity and access decisions, without asking you to replace your whole stack.

01 / IDENTITY
⌘

Keypoint-based authentication

Validate a caller identity, expiration, protocol, and configured origin before your route handles the request.

Authentication guide →
02 / ACCESS
◎

Scopes with inheritance

Express permissions directly, and resolve registered parent-to-child scope relationships.

Scope system →
03 / POLICY
⌗

Composable policy rules

Evaluate method, origin, IP, time, scope, protocol, and rate rules along the request path.

Policy engine →
04 / EXTENSION
↗

Middleware and plugins

Extend request processing with middleware, lifecycle hooks, and purpose-built plugins.

Plugin system →
05 / OPTIONAL
⌘

Small DOM facade

Parse HTML and query a supported selector subset through an optional package subpath.

HTML Parser →

WHY KEYPOINTJS

Your pipeline.
Your decisions.

Keep identity, authorization, routing, and extension points close to the request—visible in one framework flow.

Understand the lifecycle →
01

Explicit over opaque

See the middleware stages and decide where policy belongs.

02

Composable by design

Use the built-in router or integrate the request pipeline with your application.

03

Documented with limits

Know which controls are implemented and which still need application-level work.

UNDER THE HOOD

A request, step by step.

The framework composes these stages in order. CORS and keypoint validation are conditional; the core middleware sequence remains inspectable.

00HooksPre-processing
→
01ProtocolDetect & parse
→
02CORSWhen enabled
→
03IdentityIf required
→
04PolicyAccess decision
→
05PluginsRequest process
→
06RouteHandler
→
07ResponseHeaders & send
Ordinary HTTP pathWebSocket connections use the optional WebSocketGuard lifecycle.Explore architecture →

BUILT WITH CARE

Useful controls.
Honest boundaries.

Security is a system property. KeyPointJS offers building blocks; your configuration and deployment still matter.

Read security guidance →
✓

Expiration and identity checks

Reject missing, unknown, or expired keypoints in the request validator.

✓

Explicit scope decisions

Check endpoint permissions through context-aware scope inheritance.

!

Know your configuration

Secret headers are optional today; empty origin allowlists allow any origin. Review the current behavior.

!

Verify enforcement boundaries

Per-keypoint allowed IPs are not enforced by the validator. Read the security notes before deployment.

A SMALL, REAL EXAMPLE

Start with a
protected route.

Install from npm, issue an identity, then check permission where the resource is served.

Build your first API →
server.js
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');
Public npm importES modules

PACKAGE SOURCE

KeyPointJS v1.3.0

Version verified against package.json in the linked repository. Review the published package and release history before upgrading.

OPEN SOURCE, BUILT IN THE OPEN

Build with a clearer
security foundation.

Explore the implementation, open an issue, or help improve the project.