Web APIs
Find the Web APIs that Azion Runtime offers to functions, grouped by family, and detect Azion Runtime in code with the EdgeRuntime global.
Azion Runtime gives functions a set of standard Web APIs, and this page links the reference page of each one, grouped by family.
WinterTC compliance
Azion participates in WinterTC (TC55), the Ecma International Technical Committee that standardizes a minimum common API for web-interoperable server-side JavaScript runtimes. For code that runs on Azion Runtime, this participation means:
- Code written for Azion Runtime follows the same API standards as the other runtimes that implement the minimum common API.
- Azion works with WHATWG, W3C, and other standards bodies.
- A function built on WinterTC-compliant APIs behaves the same across the platforms that implement them.
Network APIs
- addEventListener - registers the handler that runs your code when a request arrives.
- fetch - sends an HTTP request from a function and resolves to a
Response. - FetchEvent - the event that a
fetchlistener receives, with the incoming request andrespondWith(). - Request - the HTTP request a function receives, or one you build to pass to
fetch(). - Response - the HTTP response a function returns, and the object
fetch()resolves to.
Encoding APIs
- Encoding - converts strings to UTF-8 bytes and back with
TextEncoderandTextDecoder.
Web Streams APIs
- TransformStream - changes data as it passes from a writable side to a readable side.
- ReadableStream - reads a stream of byte data, such as the
bodyof aResponse. - WritableStream - writes streaming data to a destination, with its own queue and backpressure.
- ReadableStreamBYOBReader - reads a byte stream into a buffer you supply, without an extra copy.
- ReadableStreamDefaultReader - reads the chunks of a
ReadableStream, such as the body of afetch()response. - WritableStreamDefaultWriter - writes to a
WritableStreamand locks it, so that no other writer can use it.
Web standards APIs
- URLPattern - matches URLs, or parts of URLs, against a pattern with capture groups.
- structuredClone - copies complex objects with the structured clone algorithm.
- Web standards - the JavaScript standard objects that functions can use, such as
MathandJSON.
V8 primitives
- WebAssembly - compiles and instantiates WebAssembly modules inside a function.
- Intl - compares strings and formats numbers, dates, and times by language.
Web Crypto APIs
- Crypto - generates cryptographically strong random values and gives access to cryptographic primitives.
- CryptoKey - a cryptographic key that a
SubtleCryptomethod returns. - SubtleCrypto - low-level cryptographic functions, such as signing, hashing, and encryption.
EventTarget
- EventTarget - the interface of objects that receive events and run the listeners registered for them.
EdgeRuntime property
Azion Runtime defines the global EdgeRuntime as a string. A check of its type tells your code that it runs on Azion Runtime. You can read the property in three ways, and each check enters its branch on Azion Runtime:
Supported types
Azion Runtime supports more JavaScript types and global objects than the Web APIs on this page. For more information, refer to Globals.