Feathers.js Security Monitoring With SecureNow: Setup Guide

Add SecureNow security monitoring to a Feathers.js app: trace the Express transport and every service endpoint, then deploy with PM2 or Docker.

Mar 26, 2026·9 min read
getting started securenow feathers

Feathers.js Security Monitoring With SecureNow: Setup Guide

Feathers.js gives you a service-oriented architecture with real-time events, hooks, and a clean separation between transport and business logic. Under the hood, most Feathers apps use Express as their HTTP transport — which means SecureNow auto-instruments both the Express layer and every Feathers service endpoint in a single step.

This guide walks through the complete setup: installing the package, authenticating with the CLI, creating an app on the free trial, checking the runtime config, instrumenting a Feathers server with a custom service, and verifying that traces land in the dashboard.

...

Prerequisites

  • Node.js 22.23.4+, 24.22.1+, or 26.12.1+ installed
  • An existing Feathers project (or willingness to scaffold one below)
  • A terminal and a browser

No SecureNow account yet? The CLI will open a browser-based signup/login flow for you.

...

Step 1: Install the Package

npm install securenow

Your project should already have Feathers dependencies installed (@feathersjs/feathers, @feathersjs/express, etc.). SecureNow does not need a Feathers-specific plugin — it instruments Express (Feathers' HTTP transport) and the Node.js http module automatically.

...

Step 2: Log In via the CLI

npx securenow login

A browser tab opens at app.securenow.ai where you can sign up or log in, then pick an application or create a new one. The CLI writes two gitignored files in your project: .securenow/runtime.json (the app key and runtime API key the SDK runs with) and .securenow/admin.json (the authorization the CLI uses).

Prefer a non-interactive flow? Generate a CLI token from your dashboard at Settings → CLI Token, then run:

npx securenow login --token YOUR_TOKEN

A token login only authorizes the CLI. Link the project to an app afterwards with npx securenow apps default <app-key> and npx securenow api-key create, which write .securenow/runtime.json.

Verify you are logged in:

npx securenow whoami
...

Step 3: Create an Application (Free Trial)

The browser step of npx securenow login already took care of this: the app you picked or created there is linked to this project, and its app key and runtime API key are saved in .securenow/runtime.json. There is nothing to copy into a .env file.

To create an app from the terminal instead:

npx securenow apps create my-feathers-api
npx securenow apps default a1b2c3d4-e5f6-7890-abcd-ef1234567890
npx securenow api-key create

apps default links the app to this project (it writes .securenow/runtime.json) and makes CLI commands target it automatically. api-key create saves the runtime API key that telemetry ingestion and firewall sync authenticate with.

...

Step 4: Check the Runtime Config

There is no .env file to write. The SDK reads its settings from .securenow/runtime.json, and every setting has a secure default, so the file works as login wrote it. The parts that matter here look like this:

{
  "apiKey": "snk_live_...",
  "app": { "key": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "name": "my-feathers-api" },
  "config": {
    "logging": { "enabled": true },
    "capture": { "body": true }
  }
}
SettingPurpose
app.keyIdentifies your app in the dashboard. Written by login.
apiKeyRuntime API key for telemetry ingestion and firewall sync. Secret: never commit it.
config.logging.enabledForwards console.log/warn/error as OTel logs (default true).
config.capture.bodyAttaches request bodies to trace spans (default true). Works with Feathers' Express transport — sensitive fields are automatically redacted.

The SDK reads only two environment variables: SECURENOW_CREDENTIALS, for hosts that cannot mount a file, and SECURENOW_DISABLED=1, which turns it off (for example in tests). SECURENOW_APPID, SECURENOW_INSTANCE and the other old SECURENOW_* variables are ignored.

...

Step 5: Instrument Your Feathers App

Add require('securenow/register') as the very first line of your entry file — before any Feathers or Express imports. Since Feathers uses Express as its HTTP transport, SecureNow auto-instruments both layers.

require('securenow/register');

const feathers = require('@feathersjs/feathers');
const express = require('@feathersjs/express');
const { NotFound } = require('@feathersjs/errors');

class TaskService {
  constructor() {
    this.tasks = [];
    this.nextId = 1;
  }

  async find(params) {
    console.log('Finding tasks', { query: params.query });
    return this.tasks;
  }

  async get(id) {
    const task = this.tasks.find((t) => t.id === Number(id));
    if (!task) throw new NotFound(`Task ${id} not found`);
    return task;
  }

  async create(data) {
    const task = { id: this.nextId++, ...data, completed: false };
    console.info('Creating task', { title: task.title });
    this.tasks.push(task);
    return task;
  }

  async patch(id, data) {
    const task = this.tasks.find((t) => t.id === Number(id));
    if (!task) throw new NotFound(`Task ${id} not found`);
    Object.assign(task, data);
    return task;
  }

  async remove(id) {
    const index = this.tasks.findIndex((t) => t.id === Number(id));
    if (index === -1) throw new NotFound(`Task ${id} not found`);
    return this.tasks.splice(index, 1)[0];
  }
}

const app = express(feathers());

app.use(express.json());
app.use(express.urlencoded({ extended: true }));
app.configure(express.rest());

app.get('/api/health', (req, res) => {
  res.json({ status: 'ok' });
});

app.use('/api/tasks', new TaskService());

app.use(express.notFound());
app.use(express.errorHandler());

const PORT = process.env.PORT || 3000;
app.listen(PORT, () => {
  console.log(`Server running on port ${PORT}`);
});

SecureNow instruments Express middleware dispatch, HTTP request/response lifecycle, and any outbound calls your services make. Feathers service methods (find, get, create, patch, remove) execute inside the request trace span, so their timing and errors are captured automatically. The same require also forwards console.* calls as OTel logs; no second preload is needed. It works in CommonJS files; ESM ("type": "module") and TypeScript (tsx) apps use the preload flag below.

Alternative: Zero Code Changes with the Preload Flag

If you prefer not to modify your entry file, pass the preload flag to Node:

node -r securenow/register app.js

Can't change the command itself? Use NODE_OPTIONS="-r securenow/register" node app.js, or the CLI wrapper npx securenow run app.js.

Or add it to package.json:

{
  "scripts": {
    "start": "node app.js",
    "start:observe": "node -r securenow/register app.js"
  }
}
...

Step 6: Start and Verify

Run your app:

node app.js

You should see:

[securenow] OTel SDK started → https://ingest.securenow.ai/v1/traces
[securenow] 📋 Logging: ENABLED → https://ingest.securenow.ai/v1/logs
Server running on port 3000

Generate some traffic against the Feathers service:

curl http://localhost:3000/api/health
curl http://localhost:3000/api/tasks
curl -X POST http://localhost:3000/api/tasks -H "Content-Type: application/json" -d '{"title":"Write docs","priority":"high"}'
curl http://localhost:3000/api/tasks/1
curl -X PATCH http://localhost:3000/api/tasks/1 -H "Content-Type: application/json" -d '{"completed":true}'

Check your dashboard:

npx securenow status

You should see your app listed as protected. Browse traces:

npx securenow traces

Or open the full dashboard at app.securenow.ai. You will see traces for each Feathers service call — find, get, create, patch — all nested under the parent HTTP request span.

...

Bonus: Useful CLI Commands

CommandWhat It Does
securenow tracesList recent traces
securenow traces show <traceId>Inspect a single trace
securenow traces analyze <traceId>AI-powered trace analysis
securenow logsList recent logs
securenow notificationsView detected security issues
securenow analyticsTraffic and performance analytics
securenow ip <address>Look up an IP address
securenow blocklist add <ip>Block a malicious IP
securenow alerts rulesManage alert rules
securenow forensicsRun natural-language forensic queries
...

Production Deployment with PM2

For production, use PM2 with an ecosystem config:

// ecosystem.config.cjs
module.exports = {
  apps: [{
    name: 'my-feathers-api',
    script: './app.js',
    instances: 4,
    exec_mode: 'cluster',
    node_args: ['-r', require.resolve('securenow/register')],
    env: {
      NODE_ENV: 'production',
    }
  }]
};
pm2 start ecosystem.config.cjs

require.resolve makes the preload an absolute path: in cluster mode a bare -r securenow/register is resolved from the PM2 daemon's folder, so the workers crash when the daemon was started elsewhere (for example by pm2 resurrect at boot). No SecureNow environment variables are needed: in fork and cluster mode, each worker reads the .securenow/ folder of the app PM2 started, and all workers report under the same service name. On the server, that folder needs the production credentials: npx securenow credentials runtime --env production writes them to .securenow/credentials.production.json; copy that file to the server as .securenow/credentials.json.

...

Docker Deployment

FROM node:22.23.4-alpine
WORKDIR /app
COPY package*.json ./
RUN npm install
COPY . .
# Mount the production credentials at /app/.securenow/credentials.json
# (generated by: npx securenow credentials runtime --env production)
ENV NODE_ENV=production
EXPOSE 3000
CMD ["node", "-r", "securenow/register", "app.js"]

On hosts that cannot mount a file (Railway, Render, Heroku, Fly.io), set a SECURENOW_CREDENTIALS secret to the value printed by npx securenow credentials runtime --env production --format env instead.

...

What SecureNow Detects Automatically

Once traces are flowing, SecureNow watches for:

  • SQL injection — malicious patterns in query parameters and request bodies
  • XSS attempts — script injection in user input
  • Credential stuffing — high-velocity failed authentication attempts
  • API abuse — unusual request patterns, rate-limit evasion, unauthorized endpoint access
  • Anomalous traffic — AI-powered detection of behavioral outliers
  • Supply-chain signals — unexpected outbound calls from your service
  • Performance degradation — slow queries, high error rates, latency spikes

Because Feathers services are exposed over HTTP via Express, every request flows through the same instrumentation pipeline. Whether a client calls POST /api/tasks or uses a Feathers client over REST, the trace is captured and analyzed.

...

Recap

StepCommand / ActionTime
Installnpm install securenow10 s
Loginnpx securenow login20 s
Create appPick or create it in the login browser step15 s
ConfigureNothing to edit: defaults live in .securenow/runtime.json0 s
InstrumentAdd require('securenow/register') as first line30 s
Verifynpx securenow status10 s

One package, one line, full coverage. Your Feathers API — Express transport and all services — is now observable and protected.

...

Next Steps

Happy shipping — and happy securing.

Frequently Asked Questions

Does SecureNow trace Feathers service hooks and lifecycle events?

SecureNow auto-instruments the Express HTTP transport that Feathers uses under the hood. Every incoming HTTP request — whether it hits a REST endpoint, a custom route, or a Feathers service — is captured as a trace span. Feathers hooks execute within that request span, so their timing is included in the trace waterfall.

Does SecureNow work with Feathers v5 (Dove) and the Koa transport?

SecureNow instruments both Express and Koa at the Node.js level. If your Feathers v5 app uses @feathersjs/koa as its HTTP transport, traces are captured automatically. The setup is identical — just require('securenow/register') as the first line.

Can I capture request bodies with Feathers?

Yes, and it is on by default (config.capture.body in .securenow/runtime.json). Since Feathers uses Express (or Koa) for HTTP parsing, the body is available on the Node.js request stream and SecureNow captures it. Sensitive fields like passwords and tokens are automatically redacted.

Will SecureNow detect attacks against Feathers custom services?

Yes. SecureNow analyzes the full HTTP request — URL, headers, query parameters, and optionally the body — regardless of which Feathers service handles it. SQL injection in query params, path traversal, and anomalous traffic patterns are all detected at the HTTP layer.

Recommended reading

Block an IP, a Range or One Route Without a Deploy (Node.js)

Block one IP, a CIDR range, or a single route and method in a Node.js app within seconds, with no code change: setup, scoping, CLI, MCP, verification and undo.

Oct 27
11 Signs Your AI-Built App Needs a Security Audit

Built your app with a coding agent? 11 warning signs it needs a security audit, each checkable in five minutes, and how to run the full audit yourself.

Oct 26
AI Security Audit Part 1: Set Up Your Agent to Audit Code

Part 1 of the AI security audit series: set up an AI coding agent to audit your app locally, connect SecureNow, and run your first threat-model pass.

Jul 24