sonobe-docs/src/usage/wasm.md
src/usage/wasm.mdRaw
1# WASM - browser usage
2
3## WASM targets
4In order to build the lib for WASM-targets, use the following command:
5```
6cargo build -p folding-schemes --no-default-features --target wasm32-unknown-unknown --features "parallel"
7```
8
9Where the target can be any WASM one and the `parallel` feature is optional.
10
11
12## WASM-compatibility & features
13
14`getrandom/js` needs to be imported in the `Cargo.toml` of the crate that uses sonobe as dependency:
15```toml
16[dependencies]
17folding-schemes = { git = "https://github.com/privacy-scaling-explorations/sonobe", package = "folding-schemes", default-features = false, features = ["parallel"] }
18getrandom = { version = "0.2", features = ["js"] }
19```
20[More details](https://docs.rs/getrandom/latest/getrandom/#webassembly-support) about `getrandom`.
21
22
23## Experimental frontends & WASM
24Not all experimental frontends are supported in the browser.
25
26### Circom frontend & WASM
27In order to use the Circom experimental browser, the feature `circom-browser` needs to be set.