Oxide SDK
Guest-side SDK for building WebAssembly applications that run inside the
Oxide browser — a binary-first browser
that fetches and executes .wasm modules instead of HTML/JavaScript.
This crate provides safe Rust wrappers around the raw host-imported functions
exposed by the "oxide" import module. It has zero dependencies.
Quick Start
Add oxide-sdk to your guest crate:
[]
= "my-oxide-app"
= "0.1.0"
= "2021"
[]
= ["cdylib"]
[]
= "0.1"
Write your app:
use *;
pub extern "C"
Build for wasm and open in the Oxide browser:
Available APIs
| Category | Functions |
|---|---|
| Canvas | canvas_clear, canvas_rect, canvas_circle, canvas_text, canvas_line, canvas_image, canvas_dimensions |
| UI Widgets | ui_button, ui_checkbox, ui_slider, ui_text_input (immediate-mode) |
| Console | log, warn, error |
| Input | mouse_position, mouse_button_down/clicked, key_down/pressed, scroll_delta, modifiers |
| Storage | storage_set/get/remove (session), kv_store_set/get/delete (persistent) |
| Networking | fetch, http_get, http_post, http_put, http_delete |
| Navigation | navigate, push_state, replace_state, get_url, history_back/forward |
| Crypto | hash_sha256, base64_encode/decode |
| Clipboard | clipboard_read, clipboard_write |
| Time / Random | time_now_ms, random_u64, random_f64 |
| Dynamic loading | load_module |
License
Apache-2.0