I Built a Retry Library Because I Kept Losing Failed API Calls
Every retry library I found did the same thing: wrap a function, retry it a few times, throw if it still fails. Fine until the retries run out and the error just... disappears into a catch block. No record of what request failed, what it was trying to send, or why. I'd find out a webhook silently dropped three days later when someone asked why an order never synced. So I built smart-retry a small…
A developer created a retry library called smart-retry to address the shortcomings of existing solutions. Most libraries merely wrap a function and retry it a few times, with no logging or record of failed requests. Smart-retry offers drop-in Axios and Fetch clients, automatic failure logging, and a way to inspect or replay failed requests.
The library defaults to retrying network errors, timeouts, 429s, and 5xx responses, and allows users to customize the conditions with a shouldRetry callback. By default, it doesn't retry Axios timeout errors, and there's no maximum limit for exponential backoff delays (a PR to address this is in progress). The library has zero test coverage and lacks detailed README documentation for log rotation configuration.
However, it has several labeled "good first issue" tasks for new contributors, and the contributing guide provides instructions to get started. To use smart-retry, npm install the package from https://github.com/AubaidFarrukh/smart-retry. Feedback and contributions are encouraged.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.