Edge Runtime APIs
The following APIs are available in the Edge Runtime.
Network APIs
- Blob
- Event
- EventTarget
- fetch
- FetchEvent
- File
- FormData
- Headers
- PromiseRejectionEvent
- Request
- Response
- WebSocket
Encoding APIs
Web Stream APIs
- ReadableStream
- ReadableStreamBYOBReader
- ReadableStreamDefaultReader
- TransformStream
- WritableStream
- WritableStreamDefaultWriter
Web Crypto APIs
Web Standards APIs
V8 Primitives
- Array
- ArrayBuffer
- Atomics
- BigInt
- BigInt64Array
- BigUint64Array
- Boolean
- clearInterval
- clearTimeout
- console
- DataView
- Date
- decodeURI
- decodeURIComponent
- encodeURI
- encodeURIComponent
- Error
- EvalError
- Float32Array
- Float64Array
- Function
- Infinity
- Int8Array
- Int16Array
- Int32Array
- Intl
- isFinite
- isNaN
- JSON
- Map
- Math
- Number
- Object
- parseFloat
- parseInt
- Promise
- Proxy
- queueMicrotask
- RangeError
- ReferenceError
- Reflect
- RegExp
- Set
- setInterval
- setTimeout
- SharedArrayBuffer
- String
- Symbol
- SyntaxError
- TypeError
- Uint8Array
- Uint8ClampedArray
- Uint16Array
- Uint32Array
- URIError
- URL
- URLSearchParams
- WeakMap
- WeakSet
- WebAssembly
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_modulescan be used, as long as they implement ES Modules and do not use native Node.js APIs- Calling
requiredirectly 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 stringnew Function(evalString): Creates a new function with the code provided as an argument
Last updated on