Waitkit

Development-only network simulation

Make the slow network happen on purpose.

Waitkit delays, fails, or hangs the requests you choose, so you can see your loading, error, timeout, and retry states before your users do. Switch scenarios at runtime from a floating panel; production builds never load it.

pnpm add -D @waitkit/core @waitkit/react
  • React
  • Vue
  • Svelte
  • Angular
  • MSW
  • Plain fetch

Live demo

This page is running Waitkit right now.
Team GET /data/team.json

The panel in the corner is @waitkit/devtools. Press Alt+Shift+W to open or close it.

States you only see on a bad day

delay Slow responses

A fixed time or a random range. Check that skeletons appear, spinners do not flash, and buttons cannot be pressed twice.

error Failed responses

Any status, headers, and body, every time or at a rate. Check the error message, the retry button, and what happens to the data already on screen.

timeout Hanging requests

The request waits and then rejects. Check that your own timeout fires, and that aborting a request really cancels it.

Set up in two files

1 Describe scenarios once


          

2 Add the panel to your app


          

waitkit validate checks the same config in CI, and an invalid config throws a WaitKitConfigError that lists every problem with its path.

Packages

@waitkit/core decides what happens to every request. The other packages only carry that decision into their environment, so a rule behaves the same everywhere. All packages share one version.