Skip to main content

Changelog

The SDK runs its own semver clock: 0.x while pre-stable, 1.0 when confident. A breaking change in the backend /links surface also forces an SDK major.

0.1.0​

Initial release.

  • client.links — full CRUD over the /links API: create, get, list, update, delete.
  • QR codes: qrSvg (SVG markup string) and qrPng (PNG Buffer), fixed 256×256 shape.
  • create/update auto-refetch: both resolve the uniform full Link via a hidden follow-up GET, on the same retry budget as the write.
  • listAll() async generator walks every page — the list envelope is exactly { data, total, page, limit }.
  • Update semantics preserved: omitted keys keep current values, JSON null clears (never dropped by the SDK).
  • Error model: OptoLinkError (HTTP failures, with status, details, retryAfterSeconds, raw) and OptoLinkConnectionError (network/timeout, status: 0).
  • Retry matrix: reads retry on connection errors, 429 (sleeping the body-communicated retryAfterSeconds), and 5xx; writes never retry on 5xx. Per-attempt timeout via AbortController.
  • Zero runtime dependencies; dual ESM + CJS; TypeScript types included; Node ≥ 18.

Compatible with OptoLink backend v2.1.0+.

Install: npm add @optomatica/optolink-sdk.