npm.io
1.2.0 • Published 2d ago

@x12i/credorix-client

Licence
UNLICENSED
Version
1.2.0
Deps
1
Size
265 kB
Vulns
0
Weekly
0

@x12i/credorix-client

The Credorix SDK for token leases, request brokering, local auth injection, and a single safe retry after a 401.

import { createCredorixClient } from "@x12i/credorix-client";

const credorix = createCredorixClient({
  serviceUrl: "http://credorix:9202",
  callerId: "service:risk-worker",
  callerToken: process.env.CREDORIX_CALLER_TOKEN!,
});

const response = await credorix.fetch("https://api.example.com/data", {
  method: "POST",
  authRef: "vendor-api",
  body: { query: "example" },
});