# Extension points — mswjs/msw

> Canonical page: https://codevetter.com/unpack/msw/extension-points

# Extension points — mswjs/msw

Scanned commit 6d6aef1640ace2ce2bd90252c71bdbc53262efd3 (2026-09-30). Generated by codevetter codevetter 1.15.0 on 2026-10-02.

Source inspection; upstream code and tests were not executed.

The experimental API exposes the same source/frame abstractions used by the built-in environments. Handler factories, custom predicates, controllers, and sibling graphs provide additional composition boundaries. WebSocket extensions can change both runtime messages and inferred APIs. Storage implementations and Vite hooks are identifiable implementation seams, with public export/build configuration determining what consumers can import.
- msw/experimental exports defineNetwork, NetworkSource, InterceptorSource, NetworkFrame, protocol frames, and handler controllers; a custom source implements enable and queues frames through an awaited emitter. — [src/core/experimental/index.ts#L1-L27](https://github.com/mswjs/msw/blob/6d6aef1640ace2ce2bd90252c71bdbc53262efd3/src/core/experimental/index.ts#L1-L27) [src/core/experimental/sources/network-source.ts#L27-L54](https://github.com/mswjs/msw/blob/6d6aef1640ace2ce2bd90252c71bdbc53262efd3/src/core/experimental/sources/network-source.ts#L27-L54)
- Custom NetworkFrame subclasses define protocol/data, handler selection, resolve, passthrough, errorWith, and unhandled diagnostics; resolve reports handled, unhandled, or skipped with true/false/null. — [src/core/experimental/frames/network-frame.ts#L19-L63](https://github.com/mswjs/msw/blob/6d6aef1640ace2ce2bd90252c71bdbc53262efd3/src/core/experimental/frames/network-frame.ts#L19-L63)
- RequestHandler subclasses supply predicate/log and may override parse/extendResolverArgs; http's createHttpHandler factory constructs HttpHandler while custom HTTP predicates can calculate resolver params. — [src/core/handlers/request-handler.ts#L225-L281](https://github.com/mswjs/msw/blob/6d6aef1640ace2ce2bd90252c71bdbc53262efd3/src/core/handlers/request-handler.ts#L225-L281) [src/http/http.ts#L38-L43](https://github.com/mswjs/msw/blob/6d6aef1640ace2ce2bd90252c71bdbc53262efd3/src/http/http.ts#L38-L43) [src/http/http-handler.ts#L146-L163](https://github.com/mswjs/msw/blob/6d6aef1640ace2ce2bd90252c71bdbc53262efd3/src/http/http-handler.ts#L146-L163)
- HandlersController abstracts getState/setState and supplies grouped use/reset/restore/dispose operations; AsyncHandlersController changes state ownership using AsyncLocalStorage rather than replacing request resolution. — [src/core/experimental/handlers-controller.ts#L83-L103](https://github.com/mswjs/msw/blob/6d6aef1640ace2ce2bd90252c71bdbc53262efd3/src/core/experimental/handlers-controller.ts#L83-L103) [src/core/experimental/handlers-controller.ts#L132-L215](https://github.com/mswjs/msw/blob/6d6aef1640ace2ce2bd90252c71bdbc53262efd3/src/core/experimental/handlers-controller.ts#L132-L215) [src/node/async-handlers-controller.ts#L30-L67](https://github.com/mswjs/msw/blob/6d6aef1640ace2ce2bd90252c71bdbc53262efd3/src/node/async-handlers-controller.ts#L30-L67)
- attachSiblingHandlers composes hidden transport/upgrade handlers with a public owner; grouping recursively visits sibling graphs and deduplicates references, while listHandlers hides implementation siblings. — [src/core/utils/internal/attach-sibling-handlers.ts#L7-L39](https://github.com/mswjs/msw/blob/6d6aef1640ace2ce2bd90252c71bdbc53262efd3/src/core/utils/internal/attach-sibling-handlers.ts#L7-L39) [src/core/experimental/handlers-controller.ts#L52-L75](https://github.com/mswjs/msw/blob/6d6aef1640ace2ce2bd90252c71bdbc53262efd3/src/core/experimental/handlers-controller.ts#L52-L75) [src/core/experimental/handlers-controller.ts#L111-L120](https://github.com/mswjs/msw/blob/6d6aef1640ace2ce2bd90252c71bdbc53262efd3/src/core/experimental/handlers-controller.ts#L111-L120) [src/graphql/graphql-subscription.ts#L1456-L1485](https://github.com/mswjs/msw/blob/6d6aef1640ace2ce2bd90252c71bdbc53262efd3/src/graphql/graphql-subscription.ts#L1456-L1485)
- WebSocketExtension is publicly re-exported; ws.link accepts ordered extensions, handler.run invokes apply and extend, and ws.onUpgrade is read at request time so later overrides affect existing links. — [src/ws/index.ts#L18-L23](https://github.com/mswjs/msw/blob/6d6aef1640ace2ce2bd90252c71bdbc53262efd3/src/ws/index.ts#L18-L23) [src/ws/websocket-handler.ts#L206-L227](https://github.com/mswjs/msw/blob/6d6aef1640ace2ce2bd90252c71bdbc53262efd3/src/ws/websocket-handler.ts#L206-L227) [src/ws/ws.ts#L183-L191](https://github.com/mswjs/msw/blob/6d6aef1640ace2ce2bd90252c71bdbc53262efd3/src/ws/ws.ts#L183-L191)
- onUnhandledFrame accepts an async callback receiving frame and defaults; predefined strategies suppress common HTTP assets, while custom callbacks must apply their own asset policy and defaults.error only prints. — [src/core/experimental/on-unhandled-frame.ts#L7-L19](https://github.com/mswjs/msw/blob/6d6aef1640ace2ce2bd90252c71bdbc53262efd3/src/core/experimental/on-unhandled-frame.ts#L7-L19) [src/core/experimental/on-unhandled-frame.ts#L75-L104](https://github.com/mswjs/msw/blob/6d6aef1640ace2ce2bd90252c71bdbc53262efd3/src/core/experimental/on-unhandled-frame.ts#L75-L104)
- WebSocketClientStore defines add/getAll/deleteMany with memory/IndexedDB implementations selected by the manager; new public utility modules are automatically discovered by tsdown and exposed through the ./utils/* export. — [src/ws/websocket-client-store.ts#L3-L13](https://github.com/mswjs/msw/blob/6d6aef1640ace2ce2bd90252c71bdbc53262efd3/src/ws/websocket-client-store.ts#L3-L13) [src/ws/websocket-client-manager.ts#L36-L42](https://github.com/mswjs/msw/blob/6d6aef1640ace2ce2bd90252c71bdbc53262efd3/src/ws/websocket-client-manager.ts#L36-L42) [tsdown.config.ts#L25-L35](https://github.com/mswjs/msw/blob/6d6aef1640ace2ce2bd90252c71bdbc53262efd3/tsdown.config.ts#L25-L35) [package.json#L47-L50](https://github.com/mswjs/msw/blob/6d6aef1640ace2ce2bd90252c71bdbc53262efd3/package.json#L47-L50)

Every claim links to its cited files at the pinned commit. Citations identify source evidence; they do not establish runtime correctness. Independent CodeVetter scan — not reviewed by upstream maintainers.

## Public product links

- [CodeVetter](https://codevetter.com/)
- [Download](https://codevetter.com/download)
- [Documentation](https://codevetter.com/docs/)
- [Source](https://github.com/Codevetter/codevetter)
