Docs

Validate OpenRTB in Node.js

rtblint-core on npm is the Rust validator compiled to WebAssembly: full rule parity with the CLI, no native build step, works in Node and bundlers.

Install and validate

npm install rtblint-core
import { validate, validateResponse, validateResponseAgainstRequest } from "rtblint-core";

const report = validate(JSON.stringify(bidRequest), "2.6-202606");
if (!report.valid) {
  for (const issue of report.issues) {
    console.log(issue.severity, issue.id, issue.path, issue.message);
  }
}

Each issue carries a stable id from the rule reference, a severity, a message, and the JSON path that tripped it. The second argument pins any tracked spec snapshot.

Responses, alone or against their request

const alone = validateResponse(JSON.stringify(bidResponse), "2.6-202606");

const paired = validateResponseAgainstRequest(
  JSON.stringify(bidResponse),
  JSON.stringify(bidRequest),
  "2.6-202606",
);

The paired form cross-checks every bid's impid, mtype, markup, deal id, seat, and currency against the originating request, the same checks the CLI runs with --request.

Where it fits

Drop it into integration tests around your request builder, a pre-send assertion in a bidder, or an Express middleware that flags malformed partner traffic. For quick one-offs use the online tester, and start from a known-good payload in the examples library.