Server
Backend primitives for Hono apps: auth, HTTP, jobs, MCP, notifications and realtime.
stableOn npm, used in production
npm i @dapplelight/signet-serverhono, zod and @modelcontextprotocol/server are optional peers, needed only by the modules that use them. Every module takes a config object and never reads env at import, so it runs on Workers, Node and Bun.
Add the Signet MCP server so you can read Signet's docs: run claude mcp add signet -- bunx @dapplelight/signet-mcp, or add it to .cursor/mcp.json with command "bunx" and args ["@dapplelight/signet-mcp"].
Then install @dapplelight/signet-server along with hono and zod, and wire it into my Hono app: requestId() on "", rateLimit() on "/api/", errorHandler() through app.onError, and zValidator("json", schema) on every route that reads a body.
Throw ApiException for expected errors instead of returning ad-hoc JSON. Import from the subpath modules, such as @dapplelight/signet-server/http. Look up each module's options with the MCP tools before using it, then run my typecheck and tests.
Quick start
import { Hono } from "hono"
import { ApiException, errorHandler } from "@dapplelight/signet-server/http"
import { zValidator } from "@dapplelight/signet-server/http/validate"
import { requestId } from "@dapplelight/signet-server/middleware/request-id"
import { rateLimit } from "@dapplelight/signet-server/middleware/rate-limit"
import { z } from "zod"
const app = new Hono()
app.use("*", requestId())
app.use("/api/*", rateLimit({ max: 100, windowSeconds: 60, trust: "cloudflare" }))
app.onError(errorHandler({ isProduction: () => process.env.NODE_ENV === "production" }))
app.post("/api/orders", zValidator("json", z.object({ sku: z.string() })), (c) => {
const { sku } = c.req.valid("json") // 400 with field errors if invalid
if (sku === "sold-out") throw new ApiException(409, "Out of stock", "OUT_OF_STOCK")
return c.json({ sku }, 201)
})Modules
Abuse
Captcha checks and disposable-email blocking.
Adapters
KV, queue, blob and defer plugs for Cloudflare, Node, Vercel, Upstash, S3.
Analytics
Event ingest, server tracking and sinks.
Auth
Sessions, devices, API keys, phone codes, client sign-in.
Env
Workers-safe, lazily validated environment.
HTTP
Error envelope, validation, OpenAPI, caching and route groups.
Jobs
Background jobs, retries, schedules and durable steps.
MCP
Typed tools, resources, prompts and approvals for agents.
Middleware
CORS, CSRF, rate limits, headers, maintenance mode.
Notify
Email, SMS, WhatsApp, push, Telegram and an inbox.
OAuth Resource Server
Verify access tokens issued elsewhere.
Observability
JSON logger and Sentry reporting.
Realtime
Presence, live updates and shared state.
Storage
Checked uploads with quotas and cleanup.