@nozle-js/node requires Node.js 18 or later and uses the built-in Fetch API.
Entity subscription APIs are introduced in 0.5.0.
Create a client
Configuration
Set both URLs explicitly outside local development. Trailing slashes are removed automatically.
Verify connectivity
API surface
API and billing
Namespaces
The package also exports
wrapOpenAI() and wrapAnthropic() for token metadata capture.
Key behavior
- Billing mutations and settlement transitions require an API key beginning with
sk_. - Entity mutations, credit transfers, and
usage.track()reject publishablepk_keys. - Mutation idempotency keys are caller-supplied and limited to 255 bytes.
- Product-credit amounts are exact decimal strings, not JavaScript numbers.
- Failed HTTP responses reject with an
Errorcontaining the operation and HTTP status. - Every request uses
AbortSignal.timeout(timeout).
Production pattern
Create one client per process and reuse it:customerId, Entity IDs, plan codes, return origins, or idempotency keys blindly from a browser. Derive or validate them in your trusted backend.