Server & Middleware

HTTP server components and middleware integrations that add Sekuire trust protocol endpoints to your existing web framework.

SekuireServer

A standalone server that exposes trust protocol endpoints:

typescript
import { SekuireServer } from '@sekuire/sdk'; const server = new SekuireServer({ port: 8000, agent: await getAgent('assistant'), beacon: { enabled: true, interval: 30_000 } }); // Automatically exposes: // GET /sekuire/hello - Agent card // POST /sekuire/auth - Authentication handshake // GET /health - Health check // GET /ready - Readiness probe await server.start();

Express Middleware

typescript
import express from 'express'; import { sekuireMiddleware } from '@sekuire/sdk/express'; const app = express(); // Adds /sekuire/* endpoints and trust headers app.use(sekuireMiddleware({ agent: await getAgent('assistant'), beacon: { enabled: true } })); // Your existing routes app.get('/api/analyze', async (req, res) => { // req.sekuire.agentId, req.sekuire.verified available res.json({ result: 'analysis' }); }); app.listen(8000);

Fastify Plugin

typescript
import Fastify from 'fastify'; import { sekuirePlugin } from '@sekuire/sdk/fastify'; const app = Fastify(); await app.register(sekuirePlugin, { agent: await getAgent('assistant'), beacon: { enabled: true } }); app.get('/api/analyze', async (request, reply) => { // request.sekuire.agentId available return { result: 'analysis' }; }); await app.listen({ port: 8000 });

Trust Headers

The middleware automatically adds trust headers to all responses:

text
X-Sekuire-Agent-ID: 7f8a9b3c2d1e... X-Sekuire-Verification: verified X-Sekuire-Reputation: 9500 X-Sekuire-Signature: ed25519_sig_of_response_body

Next Steps