Skip to main content
All JavaScript native globals are available (Object, Array, Promise, etc.). There are no built-in Node.js modules like fs, http. It’s possible to import npm packages as long as they don’t depend on Node.js Modules and missing Web Globals.

Shared Globals

The following globals are available on both the server and client side.
atob() and btoa() work on binary strings, matching browser behaviour. btoa() throws an InvalidCharacterError for characters above U+00FF, so encode text with TextEncoder first (and decode with TextDecoder) if it may contain non-Latin-1 characters.
Intl only includes DateTimeFormat, NumberFormat and ListFormat. Other members, such as Intl.RelativeTimeFormat or Intl.Collator, are not available.

Client Only

The following globals are only available on the client (web) side.

Server Only

The following globals are only available on the server side.
crypto.subtle.generateKey only supports secret key algorithms, such as HMAC and AES. Key pair algorithms, such as RSA and ECDSA, reject with NotSupportedError. A server function can hold at most 100 keys, importKey accepts at most 16 KiB of key data, and HMAC keys can be at most 1024 bits.
To compare secrets such as webhook signatures, use timingSafeEqual from attio/server.