@sanity/client compatibility with JS runtimes

You should be able to use @sanity/client from any runtime, including Cloudflare Workers, Deno, Bun, and more.

StatusNameRuntimeEntryConditionsAdapterEnvironment
Bun Canarybunexports.node.import+exports.node.requirebun, import, node, node.deno, node.importfetchbrowser
Bun Latestbunexports.node.import+exports.node.requirebun, import, node, node.deno, node.importfetchbrowser
Cloudflare Workercloudflare-workerexports.browserbrowser, import, worker, worker.browserfetchbrowser
Cloudflare Worker Node compatibility modecloudflare-workerexports.browserbrowser, import, worker, worker.browserfetchbrowser
Deno v1 npm specifierdenoexports.denodeno, import, node, node.deno, node.importfetchbrowser
Deno v1 Packages from CDNdenoexports.denodeno, import, module, worker, worker.browser, worker.nodefetchbrowser
Next.js Edge Functionvercel-edgeexports.browserbrowser, edge-light, import, module, webpack, worker, worker.browserfetchbrowser
Next.js Serverless Functionnodeexports.node.import+exports.node.requireimport, node, node.deno, node.importnodenode
Node.js CJS v14nodeexports.requirenode, node.require, requirenodenode
Node.js CJS v16nodeexports.requirenode, node.require, requirenodenode
Node.js CJS v18nodeexports.requirenode, node.require, requirenodenode
Node.js CJS v20nodeexports.requirenode, node.require, requirenodenode
Node.js CJS v21nodeexports.requirenode, node.require, requirenodenode
Node.js ESM v14nodeexports.node.import+exports.node.requireimport, node, node.deno, node.importnodenode
Node.js ESM v16nodeexports.node.import+exports.node.requireimport, node, node.deno, node.importnodenode
Node.js ESM v18nodeexports.node.import+exports.node.requireimport, node, node.deno, node.importnodenode
Node.js ESM v20nodeexports.node.import+exports.node.requireimport, node, node.deno, node.importnodenode
Node.js ESM v21nodeexports.node.import+exports.node.requireimport, node, node.deno, node.importnodenode