@zynnodehq/helio
v0.1.1
Published
TypeScript and Node.js SDK for sending application runtime logs to Helio.
Maintainers
Readme
Helio Node SDK
Send application runtime logs from Node.js and Express apps to Helio.
Install
npm install @zynnodehq/helioExpress
import express from "express";
import { createExpressMiddleware, createLogger } from "@zynnodehq/helio";
const app = express();
const logger = createLogger({
apiKey: process.env.HELIO_API_KEY!,
service: "todo-api",
environment: process.env.NODE_ENV ?? "development",
});
app.use(createExpressMiddleware(logger));
app.get("/todos", (_req, res) => {
logger.info("Fetched todos", { route: "GET /todos" });
res.json([]);
});
process.on("SIGTERM", async () => {
await logger.close();
process.exit(0);
});
app.listen(3000);Manual Logs
import { createLogger } from "@zynnodehq/helio";
const logger = createLogger({
apiKey: process.env.HELIO_API_KEY!,
service: "billing-api",
environment: "production",
});
logger.info("Checkout started", {
requestId: "req_123",
userId: "user_123",
route: "POST /checkout",
});
try {
throw new Error("Payment provider timeout");
} catch (error) {
logger.captureException(error as Error, {
requestId: "req_123",
traceId: "checkout.flow",
tags: ["payments"],
});
}
await logger.close();Test Logs
By default, the SDK sends production logs to:
https://ingest.helio.zynnode.com/v1/logs/batchTo send test logs, use a test API key and the test ingestion endpoint:
const logger = createLogger({
apiKey: process.env.HELIO_TEST_API_KEY!,
service: "todo-api",
environment: "test",
endpoint: "https://ingest-test.helio.zynnode.com/v1/logs/batch",
});Configuration
createLogger({
apiKey: "helio_live_...",
service: "api",
environment: "production",
endpoint: "https://ingest.helio.zynnode.com/v1/logs/batch",
batchSize: 20,
flushIntervalMs: 5000,
maxRetries: 3,
redactKeys: ["password", "token", "authorization"],
onError: (error) => {
console.error("Helio logging failed", error);
},
});Notes
- Logs are batched before being sent.
- Logging failures do not crash your application.
- Common sensitive keys are redacted from metadata.
- Call
logger.close()during shutdown so queued logs are flushed.
