Expand description
firebase_js_sys
is a wrapper around the firebase javascript sdk, allowing you to use it in rust.
See this package’s README for more information,
and the firebase-js
package for a high level implementation
layer ontop of this crate.
Don’t use this crate unless you are prepared to implement a lot more conversion logic, as most
of the functions return JsValue
s instead of a more useful types.
See crate firebase-js
for a more ergonomic interface.
Uses bindings hand-written using #[wasm_bindgen]
and rollup
.
§Examples:
Usage in general:
use firebase_js_sys::ModuleApp;
// Will give runtime console error
ModuleApp::initialize_app(&JsValue::UNDEFINED);
Example main.rs for using trunk
to build + run in browser:
use log::info;
use wasm_bindgen::JsValue;
fn main() {
_ = console_log::init_with_level(log::Level::Debug);
console_error_panic_hook::set_once();
info!("main.rs is running!");
// Will not work, but only gives console run time error
let app = firebase_js_sys::ModuleApp::initialize_app(&JsValue::UNDEFINED);
// println!("returned: {:?}", app);
}