The published dist/index.js can't load in a Chrome MV3 service worker: it
statically inlines @socketsecurity/lib's node http transport
(node:http/https/zlib + eval-time createRequire), so importing the SDK throws
`require is not defined` at module load.
Add a fetch-based, node-free browser bundle selected via a new `browser`
export condition.
- Route the four httpRequest imports through the lib ROOT
@socketsecurity/lib/http-request subpath (has a `browser` condition) instead
of the deep .../http-request/request path (node-only). Node build is
unchanged: node.js re-exports the identical httpRequest and still resolves
the node http transport.
- New .config/repo/rolldown.browser.config.mts: platform:'browser' +
conditionNames ['browser','import','module','default'] (mirrors socket-webext)
so lib's fetch transport (http-request/browser.js, "Designed for Chrome MV3
service workers") is selected. A node-builtin shim plugin
(.config/repo/rolldown/browser-node-shims.mts) replaces every node:* (and the
bare specifiers lib's node/* wrappers use) with browser-safe virtual modules;
fs/crypto/stream throw only when a node-only file method is called. lib's
node/os.js is stubbed so constants/platform's eager getOs() doesn't crash at
load.
- Self-contained ESM bundle (lib inlined, external []); build.mts emits it
alongside the node build.
- bundle-validation test asserts the browser bundle is node-free (AST scan).
Verified: node build byte-behavior unchanged (node:http/https/zlib transport
intact, full suite green); browser bundle has zero executable node:* / require;
loads and constructs SocketSdk with only globalThis.fetch; getQuota routes
through fetch to https://api.socket.dev.
Problem
Published `dist/index.js` can't load in a Chrome MV3 service worker: it statically inlines `@socketsecurity/lib`'s node http transport (`node:http`/`https`/`zlib` + eval-time `createRequire`), so `import`ing the SDK throws `require is not defined` at module load.
Fix
Add a fetch-based, node-free browser bundle selected via a new `browser` export condition.
Verification
tsgo + lint green.