Skip to main content

JavaScript library

Sept 2025: The new JavaScript library, c2pa-js has been released. You're encouraged to move to the new library as soon as possible.

note

The legacy JavaScript library has been moved to the c2pa-js-legacy repository.

You can continue to install and use the old library, but it will no longer be updated or supported. The Legacy JavaScript library documentation is also still available for reference.

[!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.

Using This Monorepo

This monorepo is managed by NX and pnpm. As a prerequisite for any interaction, both must be installed:

npm install -g pnpm
pnpm install

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

Packages

Please see the individual package directories for more detailed information.

packages/

Published libraries intended for production use.

c2pa-web

The SDK for interacting with C2PA metadata on the web.

c2pa-wasm

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.

c2pa-types

Exports TypeScript types autogenerated from c2pa-rs structs, used by c2pa-web.

tools/

Other tools that provide utilities for local development.

testbed

A minimal website that can be used to view c2pa-web output and as a sandbox for local development.

nx-wasm-bindgen

A custom NX executor that contains the logic for building c2pa-wasm using wasm-bindgen.

License

This project is licensed under the terms of the MIT license.