An open API service indexing awesome lists of open source software.

https://github.com/contentauth/c2pa-js


https://github.com/contentauth/c2pa-js

c2pa metadata sdk

Last synced: about 1 month ago
JSON representation

Awesome Lists containing this project

README

          

# c2pa-js

> [!NOTE]
> Looking for the old `c2pa-js` repo? It's available [here](https://github.com/contentauth/c2pa-js-legacy) 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](https://c2pa.org/) in JavaScript. Part of the [Content Authenticity Initiative](https://contentauthenticity.org/).

## Using This Monorepo

This monorepo is managed by [NX](https://nx.dev/getting-started/intro) and [pnpm](https://pnpm.io/). As a prerequisite for any interaction, both must be installed:

```sh
npm install -g pnpm
pnpm install
```

Commands are run in the following format: `nx [target] [project]`, e.g.:

```sh
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](https://github.com/contentauth/c2pa-js/tree/main/packages/c2pa-web)

The SDK for interacting with [C2PA metadata](https://c2pa.org/) on the web.

#### [c2pa-wasm](https://github.com/contentauth/c2pa-js/tree/main/packages/c2pa-wasm)

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 convenience of c2pa-web.

#### [c2pa-types](https://github.com/contentauth/c2pa-js/tree/main/packages/c2pa-types)

Exports TypeScript types autogenerated from [c2pa-rs](https://github.com/contentauth/c2pa-rs) structs, used by c2pa-web.

### `tools/`

Other tools that provide utilities for local development.

#### [testbed](https://github.com/contentauth/c2pa-js/tree/main/tools/testbed)

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

#### [nx-wasm-bindgen](https://github.com/contentauth/c2pa-js/tree/main/tools/nx-wasm-bindgen)

A custom [NX executor](https://nx.dev/concepts/executors-and-configurations) that contains the logic for building c2pa-wasm using [wasm-bindgen](https://github.com/wasm-bindgen/wasm-bindgen).

## License

This project is licensed under the terms of the [MIT license](https://github.com/contentauth/c2pa-js-v2/blob/main/LICENSE).