Skip to content

JavaScript SDK

Verify brands, check ops feeds, and scan MCP servers from JavaScript or TypeScript.

Installation

bluefox-edge 0.0.3 is on npm as the offline receipt checker only — it re-exports the standalone verifier bluefox-verify-receipt, which checks signed receipts offline, with no SDK and no API key (see Verify a Receipt). The API client this page documents arrives at 0.6+. Until then, the REST API works with zero dependencies: the quickstart curl examples cover the same calls this SDK wraps.

Initialization

javascript
import { BlueFoxClient } from 'bluefox-edge';

const client = new BlueFoxClient({ apiKey: 'YOUR_KEY' });

Brand Verification

javascript
const result = await client.checkBrand('nike', [
  'Free returns for Nike Members'
]);

console.log(result.verdict);    // first claim's verdict, e.g. "accurate"
console.log(result.confidence); // first claim's confidence, e.g. 0.95
for (const claim of result.results) {
  console.log(claim.verdict, claim.confidence, claim.evidence);
}

Ops Feeds & MCP Scanner

The ops feeds and MCP scanner endpoints are not yet wrapped by the JavaScript SDK — call them over REST with the same key:

bash
curl -H "Authorization: Bearer YOUR_KEY" \
  "https://api.bluefoxedge.ai/v1/ops/security_ops?limit=5"

Error Handling

javascript
import { BlueFoxClient, BlueFoxError, BlueFoxAPIError } from 'bluefox-edge';

const client = new BlueFoxClient({ apiKey: 'YOUR_KEY' });

try {
  const result = await client.checkBrand('nike', ['...']);
} catch (error) {
  if (error instanceof BlueFoxAPIError) {
    // error.statusCode / error.code — 429 means a rate limit was hit
    console.log(`API error: ${error.statusCode} — ${error.message}`);
  } else if (error instanceof BlueFoxError) {
    console.log(`Client error: ${error.message}`);
  }
}