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
Unreleased: the client this example imports is not on the registry yet, so the code below does not run today. It is documented ahead of its publish; the curl examples on the quickstart work now.
// UNRELEASED: the bluefox-edge API client is not on npm yet (bluefox-edge 0.0.3 is the offline receipt checker only; the client arrives at 0.6+). This import fails today — use the curl examples on /docs/quickstart.
import { BlueFoxClient } from 'bluefox-edge';
const client = new BlueFoxClient({ apiKey: 'YOUR_KEY' });Brand Verification
Unreleased: the client this example imports is not on the registry yet, so the code below does not run today. It is documented ahead of its publish; the curl examples on the quickstart work now.
// UNRELEASED: the bluefox-edge API client is not on npm yet (bluefox-edge 0.0.3 is the offline receipt checker only; the client arrives at 0.6+). This import fails today — use the curl examples on /docs/quickstart.
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:
curl -H "Authorization: Bearer YOUR_KEY" \
"https://api.bluefoxedge.ai/v1/ops/security_ops?limit=5"Error Handling
Unreleased: the client this example imports is not on the registry yet, so the code below does not run today. It is documented ahead of its publish; the curl examples on the quickstart work now.
// UNRELEASED: the bluefox-edge API client is not on npm yet (bluefox-edge 0.0.3 is the offline receipt checker only; the client arrives at 0.6+). This import fails today — use the curl examples on /docs/quickstart.
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}`);
}
}