Server runtime@cosantoir/express9 related surfaces

Express belongs to the same runtime contract, but it should still feel native to its own request boundary.

Middleware enforcement for existing Node API servers. Choose the server package when handlers, hooks, or fetch semantics are the real request boundary. The page should help you choose this surface deliberately, compare it against its lane neighbors, and keep operator proof in reach while you wire the integration.

lane family

9

Server runtime

package line

1

@cosantoir/express

contract vars

3

Shared across wrappers and native SDKs

operator lanes

2

Plus 2 native package families

@cosantoir/express@cosantoir/hono@cosantoir/fastify@cosantoir/koa@cosantoir/node@cosantoir/cli@cosantoir/mcpCOSANTOIR_GATEWAY_URLCOSANTOIR_API_KEYCOSANTOIR_SITE_IDpip install cosantoircosantoir logincosantoir-mcp@cosantoir/express@cosantoir/hono@cosantoir/fastify@cosantoir/koa@cosantoir/node@cosantoir/cli@cosantoir/mcpCOSANTOIR_GATEWAY_URLCOSANTOIR_API_KEYCOSANTOIR_SITE_IDpip install cosantoircosantoir logincosantoir-mcp

Surface fit

Choose this surface when the boundary is real, not convenient.

A better docs system tells you why this lane exists, what makes it distinct, and how it hands off to the rest of the platform.

Use this when

Choose the server package when handlers, hooks, or fetch semantics are the real request boundary.

Package line

@cosantoir/express

The install and contract line should stay recognizable even when the request lifecycle changes.

First proof

Protect one real route, loader, or handler first, then read the resulting headers and decision state before broadening the rollout.

Install line

Express package install

bash
01pnpm add @cosantoir/express @cosantoir/node
Install the surface that actually owns the request path. Do not start with a prettier abstraction and retrofit the boundary later.

Shared contract

Runtime identity

env
01COSANTOIR_GATEWAY_URL=http://localhost:4000
02COSANTOIR_API_KEY=dp_live_example
03COSANTOIR_SITE_ID=site_prod_web
These values should stay stable across framework wrappers, native SDKs, CLI probes, and MCP tools.

Contract discipline

The framework changes. The contract should not.

This is the point where the left rail, page body, and right rail need to agree: the package can change, but the gateway origin, runtime key, site id, and proof loop stay the same.

01

COSANTOIR_GATEWAY_URL

Keep this value aligned across application middleware, direct SDK probes, and operator tooling so the same request path stays explainable.

02

COSANTOIR_API_KEY

Keep this value aligned across application middleware, direct SDK probes, and operator tooling so the same request path stays explainable.

03

COSANTOIR_SITE_ID

Keep this value aligned across application middleware, direct SDK probes, and operator tooling so the same request path stays explainable.

Lane neighbors

Neighbor surfaces

A mature docs system makes adjacent choices visible. If this page is not the right boundary, the best alternative should already be in front of you.

Detailed guide

Express page guide

The framework-specific instructions live below, but they now sit inside a stronger system: lane fit above, contract line beside, neighbors nearby.

# Express Integration Use the Express wrapper with the core Node client to inject runtime security into existing pipelines. ## Installation ``bash npm install @cosantoir/express @cosantoir/node ` ## Usage `ts import express from 'express'; import { createCosantoir } from '@cosantoir/node'; import { createDeveloperProtectionExpressMiddleware, readExpressRequestIp } from '@cosantoir/express'; const app = express(); const client = createCosantoir({ baseUrl: process.env.COSANTOIR_GATEWAY_URL!, apiKey: process.env.COSANTOIR_API_KEY!, siteId: process.env.COSANTOIR_SITE_ID! }); app.use('/protected', createDeveloperProtectionExpressMiddleware({ client })); app.get('/protected', (req, res) => { const ip = readExpressRequestIp(req) ?? req.ip; res.send(This route is secure for ${ip}.); }); app.listen(3000); ``

Last updated Mar 24, 2026