diff --git a/.gitignore b/.gitignore index 82e61128..e19652bc 100644 --- a/.gitignore +++ b/.gitignore @@ -13,7 +13,8 @@ /docs/js-sdk/examples/quickstart/*.ts /docs/js-sdk/examples/view-manifest/*.ts /docs/js-sdk/examples/view-manifest/*.html -/docs/c2pa-js/*.md +/docs/c2pa-js/**/*.md +/docs/c2pa-js/packages/*.md /docs/c2pa-js/docs/*.md /docs/c2patool/readme*.md /docs/c2patool/docs/*.md diff --git a/docs/c2pa-js/packages/c2pa-types/.gitkeep b/docs/c2pa-js/packages/c2pa-types/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/docs/c2pa-js/packages/c2pa-wasm/.gitkeep b/docs/c2pa-js/packages/c2pa-wasm/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/docs/c2pa-js/packages/c2pa-web/.gitkeep b/docs/c2pa-js/packages/c2pa-web/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/docs/introduction.mdx b/docs/introduction.mdx index d2c53dec..75dd6cb8 100644 --- a/docs/introduction.mdx +++ b/docs/introduction.mdx @@ -18,14 +18,15 @@ For a series of educational videos on using the CAI open source SDK, see [**Cont The CAI open-source SDK consist of: +- [**The Rust library**](rust-sdk/readme.md) that generates the other language bindings and can also be used directly to read and generate manifest data. The Rust library is the fundamental system underlying everything else. - [**C2PA Tool**](c2patool/readme.md), a command-line tool for working with manifests and media. This tool is a wrapper around the Rust SDK and provides most of the same capabilities that it does. C2PA Tool can: - Display a report of JSON manifest data attached to an asset. - Attach a manifest data to an asset. - Add a manifest to to the associated manifest store if the asset already has an associated manifest data. -- [**JavaScript library**](c2pa-js/readme.md) that enables web pages to to read, validate, create, and sign manifest data, and embed it in supported asset files using client JavaScript. Use it to add user interface elements to your website that display manifest data while following the [C2PA user experience recommendations](https://c2pa.org/specifications/specifications/1.0/ux/UX_Recommendations.html). +- [**JavaScript library**](js-landing.mdx) that enables web pages to to read, validate, create, and sign manifest data, and embed it in supported asset files using client JavaScript. Use it to add user interface elements to your website that display manifest data while following the [C2PA user experience recommendations](https://c2pa.org/specifications/specifications/1.0/ux/UX_Recommendations.html). - **[C/C++](c2pa-cpp/readme.md), [Python](c2pa-python/readme.md), [Node.js](c2pa-node-v2/readme.md) libraries** that enable applications to read and validate manifest data, create and sign manifest data, and embed it supported asset files. - [**Mobile libraries**](mobile.md) that enable mobile applications for iOS and Android to to read and generate manifest data. -- [**The Rust library**](rust-sdk/readme.md) that generates the other language bindings and can also be used directly to read and generate manifest data. The Rust library is the fundamental system underlying everything else. + The following diagram provides a high-level view of the SDK. diff --git a/docs/js-landing.mdx b/docs/js-landing.mdx new file mode 100644 index 00000000..95d4c283 --- /dev/null +++ b/docs/js-landing.mdx @@ -0,0 +1,24 @@ +--- +id: js-landing +title: JavaScript library +--- + +:::warning As of Oct 2025 +The old, deprecated `c2pa-js` repository is now in [c2pa-js-legacy](https://github.com/contentauth/c2pa-js-legacy). If you need to work with C2PA metadata in the browser, use the libraries in this repository instead of the old library. +::: + +The [c2pa-js](c2pa-js/README.md) repository is a monorepo containing the following libraries published for production use: + + +- [**c2pa-web**](c2pa-js/packages/c2pa-web/README.md): Library for C2PA metadata in the browser. Import and use this package in browser client JavaScript code. +- [**c2pa-wasm**](c2pa-js/packages/c2pa-wasm/README.md): WebAssembly bindings for c2pa-rs, built with wasm-bindgen. They power c2pa-web; most applications should use c2pa-web instead of calling the bindings directly. +- [**c2pa-types**](c2pa-js/packages/c2pa-types/README.md): TypeScript types generated from c2pa-rs structs for use by c2pa-web and c2pa-node-v2. + + +For video walkthroughs on using the JavaScript SDK, see the following lessons from the Content Credentials Foundations course: + +- [Reading and validating C2PA data with Javascript in the browser](https://learn.contentauthenticity.org/reading-and-validating-content-credentials) +- [Formatting C2PA data for L1 - L3 disclosures](https://learn.contentauthenticity.org/formatting-c2pa-data-for-display) + + + diff --git a/docs/js-sdk/js-landing.mdx b/docs/js-sdk/js-landing.mdx deleted file mode 100644 index 4e8d9c5c..00000000 --- a/docs/js-sdk/js-landing.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -id: js-landing -title: JavaScript library -custom_edit_path: c2pa-js/edit/main/README.md ---- - -:::tip -For video walkthroughs on using the JavaScript SDK, see the following from the Content Credentials Foundations course: - -- [Reading and validating C2PA data with Javascript in the browser](https://learn.contentauthenticity.org/reading-and-validating-content-credentials) -- [Formatting C2PA data for L1 - L3 disclosures](https://learn.contentauthenticity.org/formatting-c2pa-data-for-display) - ::: - -import Readme from '../c2pa-js/readme.md'; - - null }} /> diff --git a/remote-docs.json b/remote-docs.json index 0e418554..88437f73 100644 --- a/remote-docs.json +++ b/remote-docs.json @@ -383,25 +383,26 @@ { "repo": "contentauth/c2pa-js", "path": "README.md", - "dest": "docs/c2pa-js/readme.md" + "dest": "docs/c2pa-js/README.md", + "sidebar": { "category": "c2pa-js", "label": "c2pa-js", "order": 1 } }, { "repo": "contentauth/c2pa-js", "path": "packages/c2pa-web/README.md", - "dest": "docs/c2pa-js/c2pa-web-readme.md", - "sidebar": { "category": "c2pa-js", "label": "c2pa-web", "order": 1 } + "dest": "docs/c2pa-js/packages/c2pa-web/README.md", + "sidebar": { "category": "c2pa-js", "label": "c2pa-web", "order": 2 } }, { "repo": "contentauth/c2pa-js", "path": "packages/c2pa-types/README.md", - "dest": "docs/c2pa-js/c2pa-types-readme.md", - "sidebar": { "category": "c2pa-js", "label": "c2pa-types", "order": 2 } + "dest": "docs/c2pa-js/packages/c2pa-types/README.md", + "sidebar": { "category": "c2pa-js", "label": "c2pa-types", "order": 3 } }, { "repo": "contentauth/c2pa-js", "path": "packages/c2pa-wasm/README.md", - "dest": "docs/c2pa-js/c2pa-wasm-readme.md", - "sidebar": { "category": "c2pa-js", "label": "c2pa-wasm", "order": 3 } + "dest": "docs/c2pa-js/packages/c2pa-wasm/README.md", + "sidebar": { "category": "c2pa-js", "label": "c2pa-wasm", "order": 4 } }, { "_comment": "Node.js library" }, diff --git a/sidebars.js b/sidebars.js index 7f61a1ba..2d225ed8 100644 --- a/sidebars.js +++ b/sidebars.js @@ -267,7 +267,7 @@ const sidebars = { { type: 'category', label: 'JavaScript library', - link: { type: 'doc', id: 'js-sdk/js-landing' }, + link: { type: 'doc', id: 'js-landing' }, collapsed: true, items: [ ...getRemoteSidebarItems('c2pa-js'),