Ada Extensions
Reference

Web APIs

The browser-like globals extensions have, and how they differ.

Extensions run on JavaScriptCore. All of modern JavaScript is there (async/await, Map, Intl, Array.prototype.at…); of the browser and Node APIs, only these are provided.

APINote
fetch, Headers, ResponseHTTPS and network: domains only. RequestInit: method, headers, body, timeout. Response: text(), json(), arrayBuffer(), bytes(); no streams
URL, URLSearchParams
TextEncoder, TextDecoderUTF-8 only
atob, btoa
setTimeout, setInterval, clearTimeout, clearInterval200 at most; intervals of 50 ms at least
queueMicrotask
structuredCloneJSON only: dates become strings, Map and functions are lost
performance.now()Never goes backwards
crypto.randomUUID(), crypto.getRandomValues()No crypto.subtle
console.log/info/debug/warn/error200 lines per 10 s, 2000 characters a line

How fetch differs

  • No cookies, cache, credentials, mode or signal. Use timeout to give up (1000–60000 ms, default 15000).
  • body: a string is sent as is, URLSearchParams as a form, other values as JSON.
  • 4xx/5xx don't throw; check res.ok.
  • Errors are NetworkError, TimeoutError and PermissionError.

Console

console output shows in Settings › Developer › Log and in the adanotch dev terminal. Objects are written as JSON. Error stacks go through the source map and read src/index.ts:12:5.

What isn't there

window, document, the DOM, localStorage (use ctx.storage), WebSocket, EventSource, Worker, require, process, Buffer, fs. npm packages that rely on them won't work; plain JavaScript packages (like date-fns or zod) do.

On this page