Skip to content

RuntimeEnvironment

type RuntimeEnvironment = "cloudflare-workers" | "deno" | "bun" | "node" | "unknown";

Runtime detection utility for automatic vector store selection.

Detects the current JavaScript runtime environment and returns a descriptor that helps callers choose the appropriate vector store implementation without importing all store packages.

Detection order:

  1. Cloudflare Workers (caches global, no fs)
  2. Deno (Deno global)
  3. Bun (Bun global)
  4. Node.js (process.versions.node)
  5. Unknown (fallback)