Skip to main content

js-apis

“non-hardware” APIs

Yes—browsers expose dozens of other “non-hardware” APIs that SPAs routinely lean on.
Here is a concise checklist (one-liner each) of the best-known ones, grouped by theme:

Storage & state

  • localStorage / sessionStorage – key/value strings, ~5–10 MB
  • IndexedDB – large, async, transactional object store
  • CacheStorage – programmatic HTTP cache (Service Worker)
  • Cookie Store API – modern promise-based cookie RW (Chromium)

Network & transport

  • WebSocket – full-duplex TCP-like socket over HTTP
  • Server-Sent Events (EventSource) – one-way push from server
  • Fetch / Request / Response – replacement for XHR, streams supported
  • XMLHttpRequest – legacy but still used
  • Beacon – fire-and-forget POST (analytics, unload)
  • Background Sync – replay requests when back online
  • WebTransport – QUIC-based WebSocket successor (low-latency streams)

Process & compute

  • Web Workers – OS thread, no DOM access
  • SharedArrayBuffer + Atomics – memory shared between threads
  • OffscreenCanvas – GPU rendering in a worker
  • WebAssembly – run C++/Rust at near-native speed
  • Compute Pressure – observe CPU load (origin trial)

Media & capture

  • MediaDevices.getUserMedia – camera / mic
  • MediaRecorder – encode chunks to WebM/MP4 in-browser
  • WebCodecs – low-level audio/video encode/decode
  • ImageCapture – grab stills from camera with full control
  • Screen Capture (getDisplayMedia) – record/tab-cast

Files & drag-and-drop

  • File / FileReader / FileWriter – read user-selected files
  • File System Access API – r/w real disk files & folders
  • Drag-and-Drop – native desktop-to-browser file drop

Notifications & engagement

  • Notifications – system-level toast
  • Push API – re-engage users from server (requires SW)
  • Page Visibility – detect tab switch / minimize
  • Idle Detection – know when user is away

Performance & diagnostics

  • Performance / PerformanceObserver – navigation, resource, paint, long-task, INP
  • User-Timing – custom marks & measures
  • NetInfo – downlink, rtt, save-data hint
  • Reporting API – browser sends CSP/deprecation crashes to endpoint

Security & credentials

  • Credential Management – auto-sign-in with saved passwords
  • WebAuthn – FIDO2 / Passkey public-key login
  • Permissions – query & request fine-grained rights

Intl & text

  • Intl.* – collation, date/time, number, list, segmenter
  • Encoding API – TextEncoder/TextDecoder (UTF-8, etc.)

This list plus the earlier hardware APIs give you the full modern browser “toolbox” for SPAs.

Hardware APIs

Modern SPAs can tap the following built-in JavaScript / Web APIs to reach real hardware or OS-level features without leaving the browser:

  • WebGPU – GPU compute & 3-D rendering (CUDA / ML-class workloads)
  • WebGL / WebGL2 – hardware-accelerated 2-D/3-D graphics
  • WebXR – VR/AR headsets, motion controllers, room-scale tracking
  • Web Audio + Web MIDI – audio I/O, MIDI instruments, low-latency DSP
  • WebHID – raw access to human-interface devices (joysticks, pedals, etc.)
  • WebUSB – talk to USB devices (3-D printers, micro-controllers)
  • WebSerial – direct serial port for IoT, Arduino, Pi
  • WebBluetooth – pair with BLE peripherals (heart-rate, bulbs, drones)
  • WebNFC – read/write NFC tags on phones & kiosks
  • Geolocation – GPS / GLONASS / Galileo coordinates
  • DeviceOrientation / DeviceMotion – accelerometer, gyro, compass
  • AmbientLight & Proximity – light & distance sensors (mobile)
  • WebRTC – camera, mic, peer-to-peer streaming
  • Shape Detection (Barcode/Face/Text) – hardware-accelerated recognition
  • WebCodecs – low-level video encode/decode for camera pipelines
  • WebShare / WebShare Target – native share sheet & file receipt
  • Contact Picker – select phone contacts
  • WebOTP – read SMS verification codes
  • Battery Status – monitor battery level & charging state
  • Network Information – connection type, speed, metered hints
  • WakeLock – keep screen or system awake
  • WebAssembly SIMD & Threads – near-native CPU vector & parallel work

These APIs are exposed directly through navigator.* or window.* and work inside any modern SPA built with React, Vue, Angular, Svelte, etc.