Note
Looking for the old c2pa-js repo? It's available here as c2pa-js-legacy. Those packages are now deprecated and implementors wishing to interact with C2PA metadata on the web should use the libraries in this repo instead.
A collection of libraries and tools that enable interaction with C2PA metadata in JavaScript. Part of the Content Authenticity Initiative.
This monorepo is managed by NX and pnpm.
The following must be installed before working with this monorepo:
Node.js v22 or later is required (earlier versions may fail with build errors related to unknown file extensions).
If you use nvm, you can install the required version with:
nvm install <version>
nvm install 22.22.0Install pnpm and NX.
npm install -g pnpm
npm install -g nxIf you plan to build from source (rather than only consuming published packages), the Rust toolchain and additional prerequisites are required. See c2pa-wasm's prerequisites for full details.
- Install Node.js, pnpm, and NX (see above).
- Install the Rust toolchain and
c2pa-wasmprerequisites (seepackages/c2pa-wasm/README.md). - Run
pnpm installfrom the repo root to install the project's dependencies.
Commands are run in the following format: nx [target] [project], e.g.:
nx build c2pa-web # This will build c2pa-web and all of its dependencies
nx test c2pa-web # This will build and run the tests defined in the c2pa-web package
nx lint c2pa-web # This will run ESLint on the c2pa-web package
nx lint c2pa-web --fix # This will run ESLint on the c2pa-web package and fix any errorsIf your changes should be part of a release, you will need to create and commit a changeset.
To create a new changeset, from the root repo directory, run:
pnpm changesetFollow the prompts to bump the version numbers of affected packages as appropriate. This will generate a new changeset markdown file in the .changeset directory, which should then be committed as part of your PR.
Once the PR is merge into main, the changeset bot will create a release PR, which will then be reviewed, merged, and result in a new release being published.
Please see the individual package directories for more detailed information.
Published libraries intended for production use.
The SDK for interacting with C2PA metadata on the web.
The 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.
Exports TypeScript types autogenerated from c2pa-rs structs, used by c2pa-web.
Other tools that provide utilities for local development.
A minimal website that can be used to view c2pa-web output and as a sandbox for local development.
A custom NX executor that contains the logic for building c2pa-wasm using wasm-bindgen.
This project is licensed under the terms of the MIT license.