# LoopBack API monitoring, logging and security - ApiTraffic

> LoopBack API monitoring and logging that also secures it: requests traced, attacks blocked, vulnerable npm packages found. Installs as a LoopBack component.

Source: https://www.apitraffic.io/loopback

LoopBack API monitoring, logging and security · First-party SDK

# LoopBack API monitoring that’s your security team, SRE and auditor. In one npm install.

ApiTraffic is LoopBack API monitoring and logging that runs inside your app. It blocks the attacks your edge can’t see, finds vulnerable npm packages and leaking data, catches breaking changes and slow deploys, and hands you the fix.

[Start your free trial](https://app.apitraffic.io/signup?src=framework-loopback)

`npm i @apitraffic/loopback`

One component in your application. It runs ahead of the whole sequence, so it sees every request - including the ones your controllers never do.

```
// src/application.ts
import { ApplicationConfig } from '@loopback/core';
import { RestApplication } from '@loopback/rest';
import { ApiTrafficBindings, ApiTrafficComponent } from '@apitraffic/loopback';

export class MyApplication extends RestApplication {
  constructor(options: ApplicationConfig = {}) {
    super(options);

    this.configure(ApiTrafficBindings.COMPONENT).to({
      token: process.env.API_TRAFFIC_TOKEN,
      bucket: process.env.API_TRAFFIC_BUCKET,
    });
    this.component(ApiTrafficComponent);
  }
}
```

Configure it before registering it. Works with the middleware sequence and the older action-based one alike.

`@apitraffic/loopback` records each request with the route LoopBack matched, controller and REST base paths included, and the firewall runs ahead of the sequence and again once the body is parsed, enabled from your account like everywhere else. `tag()`, `trace()` and `span()` work in interceptors, middleware, services and repositories as well as in your controllers, and `app.stop()` delivers what was captured before the process exits.

LoopBack 4 · Node 20+ · types included · [LoopBack setup guide](/docs/integrations/loopback) · [read the middleware source](https://github.com/apitraffic/apitraffic-node)

LoopBack

## What this looks like in LoopBack

### The sequence is where a request is decided

LoopBack 4 routes through a sequence - CORS, middleware, find route, authentication, parse params, invoke. The component records the request before any of it runs, so a request rejected anywhere in the sequence is still a record, with its final status and the route LoopBack matched.

### OpenAPI is a declaration, not a description of traffic

LoopBack generates a spec from your controllers. That is the inventory you meant to run. Discovery compares it to the endpoints actually taking traffic, which is a different list more often than anyone expects.

### Repositories make the query count invisible

A relation resolved per record is an N+1 that reads like one line of code. The span waterfall attributes every query to the request that caused it.

More than LoopBack logging

## A logger writes the request down. ApiTraffic does something about it.

LoopBack logging with pino, winston or morgan writes a line and stops there. ApiTraffic runs in your LoopBack process, in the request path, so it can act as well as record. Here is what happens to every request your API handles:

- POST /v1/checkout
- ### 1Screened OWASP rules, rate limits, IP reputation and caller behavior, checked before your handler runs. A bad request is refused there.

- ### 2Redacted Credential headers and secret-looking keys are masked inside your process, before anything leaves your server.
- ### 3Recorded Full Node.js API logging: headers, bodies, status and timing, inbound and outbound, grouped by endpoint and searchable by any field.

- ### 4Traced Every query, cache call and outbound request, tied to the line of code that ran it. N+1 queries flagged.
- ### 5Judged Compared with the endpoint’s own normal and its learned response shape, so a regression or a breaking change is caught.

- ### 6Counted as evidence Feeds the daily SOC 2, PCI DSS and HECVAT checks and the map of where sensitive data flows.

One middleware, one record per request, every feature reading it. Nothing to line up by request ID across three products at 2am.

LoopBack API security

## Stop the attacks your edge can’t see

Your edge decides whether a request gets in. ApiTraffic sees what happens inside your LoopBack app after it did: a valid key behaving unlike itself, a vulnerable package your code loads, personal data walking out to a vendor.

### An edge WAF sees a request. Yours sees the request your code sees.

The ApiTraffic WAF runs as middleware, after your body parser, so it inspects exactly what your handler is about to read - and every verdict lands on the same record as the trace.

- **OWASP managed rules** for SQL injection, XSS, RCE, SSRF and more
- **Behavioral protection:** callers walking object IDs, collecting 401s, probing or moving at machine speed

- **Explainable blocks:** the rule, the field, the score and the policy on every request

[Explore the firewall →](/waf)

Catch & fix

## LoopBack API monitoring that finds it before your customers do

Every endpoint learns its own normal, every deploy is watched, and when something changes you get one incident with the evidence attached.

### One list of what needs you right now

A breaking change, a slow endpoint and a burst of firewall blocks, side by side and ranked, each one a click from its evidence. No dashboard to build first.

[How alerting works →](/monitoring#alerts)

Every screenshot on this page is the real ApiTraffic app, showing the sample API every new account can explore.

One bill

## Seven tools. One install. One bill.

The jobs below usually mean separate products, separate bills and separate places to look. ApiTraffic does them from one record per request.

- Request logger
- APM

- Alerting & on-call routing
- Web application firewall

- Dependency vulnerability scanner
- Sensitive data discovery

- Compliance evidence collection

[Start your free trial](https://app.apitraffic.io/signup?src=framework-loopback-value)[See published pricing →](/pricing)

FAQ

## LoopBack API monitoring questions

Install @apitraffic/loopback, configure ApiTrafficBindings.COMPONENT with your ingest token and bucket, and register ApiTrafficComponent in your application's constructor. Every request is then recorded, with no agent or sidecar to run.

LoopBack 4, on Node 20 or later. TypeScript types are included.

No network call to ApiTraffic happens between your handler and your response: the SDK records each request in-process and returns immediately, and payloads are batched, compressed and sent in the background. If ApiTraffic is unreachable, your API keeps serving requests.

Yes. A web application firewall runs inside your LoopBack app with OWASP rules, rate limits and behavioral protection against callers that walk object IDs or probe for endpoints. Run it in monitor mode first and replay real traffic through a policy before it blocks anything. The Security Center also lists vulnerable npm packages and Node.js versions your services actually load, and sensitive data discovery shows where personal data flows unredacted.

The method, the endpoint it matched (so /users/42 and /users/43 group as one), the status, timing, headers and bodies, and the firewall verdict, plus the queries and outbound calls it made when APM is on. Credential headers and secret-looking fields are masked in your process before anything is sent.

**Cloudflare decides whether a request gets in. We record what happened after it did.**

Those are different jobs, and the gap between them is where most API incidents live. Your edge sees strangers - unknown IPs, bad signatures, known-bad patterns - and it’s good at that. What it can’t see is a legitimate, authenticated key behaving unlike itself: enumerating IDs one at a time, pulling fifty times its normal volume on a Sunday, or walking endpoints it has never touched before. That traffic passes every edge check, because it’s a customer.

Keep Cloudflare. We’re the layer inside your app where the caller has a name, a history, and a bill. [The full comparison](/vs/cloudflare-waf) says what each one does better.

**Datadog is a much broader product.** If you need to monitor a Kafka cluster, build custom dashboards for forty services, and correlate across your whole estate, use Datadog - we’re not that, and we’re not trying to be.

We answer one question well: who called your API, and what happened. Because logging, timing, and screening run in one middleware, you get one record per request with the trace and the security verdict already on it. Nothing to correlate by request ID across three products and three clocks at 2am.

The other difference is structural. There’s no host agent to deploy, so there’s no per-host meter and no bill that grows every time you add a container.

What we don’t do: infrastructure monitoring, RUM, log ingestion from things that aren’t your API, or 800 integrations. [The full comparison](/vs/datadog) covers pricing and running both.

**No. The middleware fails open.**

If our collector is unreachable, requests complete exactly as they would without us. Telemetry queues into a bounded in-memory buffer and is dropped once that buffer is full - it never grows without limit, and it never blocks a response. You lose visibility for the duration of the outage. You don’t lose traffic.

Enforcement is a separate question, and the answer is better than fail-open usually implies. Verdicts are evaluated in your process against the policy you last synced, not by calling us - so a rule that was live when the connection dropped is still live now. During an outage you stop receiving policy changes; you do not stop being protected. The kill switch works the same way: `API_TRAFFIC_WAF_ENABLED=false` takes effect without a deploy and without reaching us, which is the case that matters when we are the problem.

**Yes, through the proxy URL - and the SDKs are Node because that is where we can go deepest.**

For any other stack, generate a proxy URL for your bucket: the same URL as your API call with only the hostname changed. Calls sent through it land in your request log, searchable, grouped by endpoint and watched by alerting, from any language and with no code to install.

The SDKs add what only an in-process middleware can see: your route definitions (`/users/:id` as one endpoint instead of forty thousand paths), the outbound calls your app makes, the queries behind each request, and a firewall that inspects the parsed request. That is why the first-party SDKs are for Node frameworks.

**You decide what is kept, and the secrets are masked before you configure anything.**

From the very first request, credential headers - `Authorization`, cookies, API key and CSRF headers - and secret-looking keys in bodies and query strings are masked inside your process, before anything is sent.

On top of that, redaction rules mask your own fields, either in your app so the value never leaves your server or on our side just before storage. Exclusion rules keep a route out entirely, or log its requests without their bodies. Everything you see afterwards - the request log, share links, embeds, the API and the MCP server - sees only the redacted value.

**Keep them. Application logs are what your code chose to say. We record what actually crossed the wire.**

The difference shows up on the requests you didn’t write a log line for: the ones that 404’d before reaching a handler, the ones that failed auth, the ones hitting a route someone shipped last quarter and forgot. Those don’t appear in your app logs precisely because your code never ran - and they’re disproportionately the ones worth looking at.

There’s also no correlation step. The timing and the verdict are already on the record; you’re not grepping a log drain and joining it to something else by hand.

The middleware is [public on GitHub](https://github.com/apitraffic/apitraffic-node) if you’d rather read it than take our word for what it does on the request path.

**ApiTraffic tells you - alerts are on every plan.**

Every endpoint is compared with its own normal, and a change has to be a multiple of normal, big in real terms and statistically real before anyone is told. Related alerts become one incident, sent to Slack, email, PagerDuty, Jira or a webhook following your routing. Each alert says why it was grouped, traffic alerts link straight to the requests behind them, and an alert that needs its own owner can be split into an incident of its own. Drift detection adds breaking API changes, certificate monitoring warns you before the certificate of a host your API calls expires, and deploy markers let you see which release changed what. [How alerting works](/monitoring)

Other frameworks

[Express](/express)[Fastify](/fastify)[NestJS](/nestjs)[Koa](/koa)[Hapi](/hapi)[Meteor](/meteor)[Sails](/sails)[Strapi](/strapi)[AdonisJS](/adonisjs)

## LoopBack API monitoring that’s your security team, SRE and auditor. In one npm install.

Your first requests arrive in minutes, screened by the firewall, traced to the query and judged against a baseline that is already building.

[Start your free trial](https://app.apitraffic.io/signup?src=framework-loopback-closing)

Free trial · No credit card · Set up in minutes
