Edge Runtime APIs

Edge Runtime APIs

The following APIs are available in the Edge Runtime.

Network APIs

Encoding APIs

Web Stream APIs

Web Crypto APIs

Web Standards APIs

V8 Primitives

Addressing the runtime

In addition to the above-mentioned APIs, a globalThis.EdgeRuntime property is also available that can be used to address the runtime:

if (typeof EdgeRuntime !== 'string') {
  // dead-code elimination is enabled for the code inside this block

Unsupported APIs

The Edge Runtime has some restrictions including:

  • Native Node.js APIs are not supported. For example, you can't read or write to the filesystem
  • node_modules can be used, as long as they implement ES Modules and do not use native Node.js APIs
  • Calling require directly is not allowed. Use ES Modules instead

The following JavaScript language features are disabled, and will not work:

  • eval: Evaluates JavaScript code represented as a string
  • new Function(evalString): Creates a new function with the code provided as an argument