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/linksAPI:create,get,list,update,delete.- QR codes:
qrSvg(SVG markup string) andqrPng(PNGBuffer), fixed 256×256 shape. create/updateauto-refetch: both resolve the uniform fullLinkvia a hidden follow-upGET, 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
nullclears (never dropped by the SDK). - Error model:
OptoLinkError(HTTP failures, withstatus,details,retryAfterSeconds,raw) andOptoLinkConnectionError(network/timeout,status: 0). - Retry matrix: reads retry on connection errors,
429(sleeping the body-communicatedretryAfterSeconds), and5xx; writes never retry on5xx. Per-attempt timeout viaAbortController. - Zero runtime dependencies; dual ESM + CJS; TypeScript types included; Node ≥ 18.
Compatible with OptoLink backend v2.1.0+.
Install: npm add @optomatica/optolink-sdk.