JavaScript APIs / JavaScript APIs overview

JavaScript APIs overview

Oro Runtime apps run inside the platform WebView. You use standard web APIs (DOM, ES modules, fetch, URLs, WebCrypto, WebAssembly) and import Oro-specific native capabilities as explicit ES modules under the oro:* namespace.

Web APIs are globals#

Use fetch, URL, Headers, Request, Response, AbortController, streams, Worker, SharedWorker, localStorage, and navigator.serviceWorker directly. They need no oro:* imports. The web platform guide covers networking, storage, media, cryptography, files, device capabilities, and platform differences.

Build an interface with React and Vite or another static frontend tool, then package it for Android and iOS.

How the JavaScript surface is organized#

The runtime’s JavaScript surface is broad, but it stays predictable:

Native services in Runtime 0.2#

Use native platform services to check backend support before enabling an operation:

  • oro:platform discovers compiled backends; it does not grant permission or prove runtime availability.
  • oro:authentication and oro:credentials separate cryptographic key operations from explicit password-provider selection.
  • oro:foreground, oro:background/deferred, and oro:push provide registered native execution and transport on Android/Linux, with feature-specific admission and lifetime limits.
  • oro:workflows and oro:migration expose Android-only high-level executors. Shared storage or lower-level Linux services do not make these executors available on other platforms.
  • oro:launcher, oro:document-access, oro:network-status, and oro:haptics cover destinations, Android provider grants, Android/Linux network paths, and optional Android feedback.
  • oro:window/appearance and oro:window/back extend the window reference with insets, gestures, and bounded native Back handling. Diagnostics add compiled capabilities and Android build identity without exporting private correlation data.

See Runtime 0.2 releases for upgrade steps and editor tooling for the matching CLI/server models.

Importing oro:* modules#

Modules are standard ES modules:

import application from 'oro:application'
import { onReady } from 'oro:hooks'
import * as secureStorage from 'oro:secure-storage'

If you need an exhaustive list of every oro:* specifier (including subpaths), see: All module specifiers.

Runtime boundary#

Most application code does not need a special runtime-detection branch. Import the oro:* modules you actually use and treat those imports as the explicit native-capability boundary.

Configuration in JavaScript#

oro:application exposes the effective application configuration as application.config.

Config keys are flattened (for example meta_bundle_identifier, build_output) rather than nested tables.

import application from 'oro:application'

console.log(application.config.meta_bundle_identifier)
console.log(application.runtimeVersion)

If you’re looking for the TOML keys and defaults, see: Configuration.

Next#

Source repository · Edit this page · View Markdown

Quick links

Type to search across the site. Use the up and down arrow keys to choose a result, Enter to open it, and Escape to close.