@phylaco/node
v0.1.4
Published
Phylaco Node telemetry SDK
Maintainers
Readme
@phylaco/node
🚀 Features
- Automatic request tracking (Express middleware)
- API performance monitoring
- Error detection & classification
- Trace correlation (OpenTelemetry compatible)
- Data sanitization (PII protection)
- Retry & batching system
📦 Installation
npm install @phylaco/node⚡ Quick Start
import express from "express";
import { phylaco } from "@phylaco/node";
const app = express();
phylaco.init(app, {
ingestUrl: process.env.PHYLACO_INGEST_URL,
projectKey: process.env.PHYLACO_PROJECT_KEY,
serviceName: process.env.PHYLACO_SERVICE_NAME || "my-backend",
debug: process.env.PHYLACO_DEBUG === "true",
});
app.get("/api/test", (req, res) => {
res.json({ success: true });
});
app.listen(3000);🧾 .env Example
PHYLACO_INGEST_URL=https://api.phylaco.com/api/v1/guard/ingest/events/ingest
PHYLACO_PROJECT_KEY=ingest_api_key
PHYLACO_SERVICE_NAME=my-backend
PHYLACO_DEBUG=false🔧 Configuration
| Option | Type | Required | Description | | ----------------- | ------- | -------- | ------------------ | | ingestUrl | string | ✅ | Phylaco ingest API | | projectKey | string | ✅ | Project auth key | | serviceName | string | ❌ | Service identifier | | debug | boolean | ❌ | Enable debug logs | | capturePathPrefix | string | ❌ | Filter routes |
👤 User Identification
import { identify } from "@phylaco/node";
identify("user_123");🔒 Data Protection
Sensitive fields automatically masked:
- password
- token
- authorization
Deep object sanitization enabled
🧠 What SDK Does
✔ Collects signals ✔ Tracks performance ✔ Sends events
❌ Does NOT do:
- ML
- risk scoring
- behavior analysis
👉 That happens in Phylaco backend
📊 Event Example
{
"type": "backend_request",
"route": "/api/user/:id",
"status": 200,
"duration": 120,
"success": true
}🛠 Development
npm run build
npm run typecheck📄 License
MIT
