oxide-sdk 0.1.0

Guest SDK for building .wasm applications that run inside the Oxide browser
Documentation
  • Coverage
  • 45.45%
    75 out of 165 items documented0 out of 107 items with examples
  • Size
  • Source code size: 45.86 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 5.27 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 15s Average build duration of successful builds.
  • all releases: 15s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • niklabh/oxide
    12 4 9
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • niklabh

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:

[package]
name = "my-oxide-app"
version = "0.1.0"
edition = "2021"

[lib]
crate-type = ["cdylib"]

[dependencies]
oxide-sdk = "0.1"

Write your app:

use oxide_sdk::*;

#[no_mangle]
pub extern "C" fn start_app() {
    log("Hello from Oxide!");
    canvas_clear(30, 30, 46, 255);
    canvas_text(20.0, 40.0, 28.0, 255, 255, 255, "Welcome to Oxide");
}

Build for wasm and open in the Oxide browser:

rustup target add wasm32-unknown-unknown
cargo build --target wasm32-unknown-unknown --release

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