The WebAssembly wrapper for [`c2pa-rs`](https://github.com/contentauth/c2pa-rs) that powers `c2pa-web`, built with [wasm-bindgen](https://github.com/wasm-bindgen/wasm-bindgen). While these bindings can be used directly, most users will prefer the convenie
npm install @contentauth/c2pa-wasmThe WebAssembly wrapper for c2pa-rs that powers c2pa-web, built with wasm-bindgen. While these bindings can be used directly, most users will prefer the convenience of c2pa-web.
``sh`
npm install @contentauth/c2pa-wasm
Ensure the repo-wide prerequisites NX and pnpm are installed.
Then, all of the following prerequisites must be installed before c2pa-wasm can be built:
#### Rust
Minimum supported Rust version: 1.86.0.
Additionally, the wasm32-unknown-unknown target must be installed:
`sh`
rustup target add wasm32-unknown-unknown
#### wasm-bindgen-cli
`sh`
cargo install wasm-bindgen-cli@0.2.106
#### wasm-pack
`sh`
cargo install wasm-pack@0.13.1
To build the library:
`sh`
nx build c2pa-wasm
This will execute the commands defined in the nx-wasm-bindgen executor to produce the final output in the pkg/ directory.
The library relies on wasm-pack to run its tests. As a general principle, the majority of test coverage will come from c2pa-web's test suite.
To run the tests:
```
nx test c2pa-wasm