Cereal docs
TypeScript SDK

Node HTTP adapter

Serve SDK Fetch handlers through Node HTTP, Express, or Fastify.

Import createNodeHandler, toWebRequest, and writeWebResponse from @trycereal/sdk/node. The core SDK uses Web Request/Response; this separate entry point bridges Node streams.

HelperContract
createNodeHandler(app, options)Signature
toWebRequest(request, options)Signature
writeWebResponse(response, outgoing)Signature
Request optionsNodeRequestOptions

Preserve the exact signed body bytes. Mount the bridge before a JSON parser, or pass the original raw buffer to toWebRequest. Do not stringify a parsed request body. Set origin to your application's public origin when running behind a proxy; forwarded headers are not implicitly trusted. The default body limit is 1 MiB.

See framework integrations for complete mounting examples and the research starter for a Node application.