HeliumTS is under active development and may have bugs or breaking changes. Report issues on GitHub.
Production Deployment
Helium's production build runs a Node.js HTTP server for typed RPC, streaming methods, custom handlers, and SSR. Generated static pages and browser assets are served by the same process. Deploy the server as an HTTP service; framework RPC needs no upgrade endpoint or connection-affinity setup.
Build and start
%npm ci%npm run build%npm run start%# Or: node dist/server.js
Use Node.js 20.19+ on Node 20, or 22.12+. The default port is 3000 and PORT can override it. Keep runtime dependencies available beside the build output.
Configuration and secrets
The build bundles helium.config.ts, .js, or .mjs into dist/helium.config.js. Both start commands load the build directory first, then the project root. Set HELIUM_CONFIG_DIR only when intentionally deploying configuration separately.
Set a stable, private HELIUM_SECRET shared by all instances that handle your app's traffic. Keep database and provider credentials server-side. Only HELIUM_PUBLIC_ variables are exposed through Helium's browser environment support.
HTTP requests and streaming
Allow HTTP POST RPC requests and preserve cookies and required headers. Keep request-size and per-IP rate limits enabled. Normal calls use MessagePack with batching; async-generator methods send incremental responses consumed by useStreaming.
Disable response buffering for streaming requests and set proxy idle timeouts above the longest expected pause between chunks. Compression or caching middleware must not hold the whole streaming response before forwarding it. Client cancellation should reach the Node process so ctx.signal can stop upstream work.
Trusted proxies
1import type { HeliumConfig } from "heliumts/server";23const config: HeliumConfig = {4 trustProxyDepth: 1, // Only when there is exactly one trusted reverse proxy.5 rpc: {6 maxBodySize: 1_048_576,7 maxBatchSize: 20,8 security: {9 maxRequestsPerWindow: 100,10 rateLimitWindowMs: 60_000,11 tokenValidityMs: 30_000,12 },13 },14};1516export default config;
Use zero for direct connections. Trusted proxies must sanitize forwarded headers. In-memory limits are process-local; enforce shared quotas outside the process when scaling across instances.
Static hosts, functions, and workers
A static-only host can serve generated HTML and assets but cannot execute RPC, auth handlers, or SSR. HTTP-only RPC does not automatically turn the generated Node server into a provider-specific serverless function; that requires an appropriate runtime adapter. Check its streaming and request-duration support.
Background workers start in every server instance unless disabled by your configuration. Deploy scheduled or singleton work deliberately so scaling the web service does not duplicate it.
Release checks
- Rebuild client and server together when changing framework versions.
- Check RPC auth, cookies, rate limits, and SSR through the deployed proxy.
- Confirm incremental chunks reach the browser before the response completes and cancellation stops upstream work.