Transparently manages a cookie jar across requests:
beforeRequest: injects matching cookies as the Cookie header.
afterRequest: captures Set-Cookie response headers into the jar.
Works in both browser (alongside native cookie jar) and Node.js
(where the native fetch has no cookie jar).
Persistence is coalesced via queueMicrotask: any burst of jar mutations
in the same tick produces exactly one adapter.save() call. For graceful
shutdown, call plugin.flush().
For horizontal scaling, provide an adapter (e.g., Redis) and set
syncOnRequest: true to reload the jar from the adapter before each request.
Cookie plugin for FetchEngine.
Transparently manages a cookie jar across requests:
beforeRequest: injects matching cookies as theCookieheader.afterRequest: capturesSet-Cookieresponse headers into the jar.Works in both browser (alongside native cookie jar) and Node.js (where the native fetch has no cookie jar).
Persistence is coalesced via
queueMicrotask: any burst of jar mutations in the same tick produces exactly oneadapter.save()call. For graceful shutdown, callplugin.flush().For horizontal scaling, provide an
adapter(e.g., Redis) and setsyncOnRequest: trueto reload the jar from the adapter before each request.