You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The version numbers provided in the CDN URLs _must_ match in all of the places you reference the
48
-
library. To make it easy, use a variable that provides the version as shown in the example.
47
+
The version numbers provided in the CDN URLs _must_ be the same in all of the places you reference the library. To make it easy, use a variable that provides the version as shown in the example.
You can also bring in the library with a package manager, such as `npm`, `pnpm`, or `yarn`. This way, all of the client side code is hosted with your app and there are no external dependencies. For example, using `npm`:
@@ -71,24 +68,33 @@ Be sure to configure your server to send proper `Content-Type` headers for these
71
68
72
69
Examples for common build systems are shown below. They are also available in the [c2pa-js-examples repository](https://github.com/contentauth/c2pa-js-examples).
73
70
74
-
exportconst ExampleLink = ({ example }) => {
75
-
const linkText =`examples/${example}`;
76
-
const link =`https://github.com/contentauth/c2pa-js/tree/main/${linkText}`;
77
-
return (
78
-
<divclassName="example-link">
79
-
An example project is available here: <ahref={link}>{linkText}</a>
The source code for this example is in the [c2pa-js-examples repo](https://github.com/contentauth/c2pa-js-examples/blob/main/minimal-ts-vite/examples/active-manifest/main.ts).
The way that you import `wasmSrc` and `workerSrc` varies depending on the build system you use. For more information, see [Quick start](../getting-started/quick-start#bringing-in-the-library).
@@ -20,10 +17,35 @@ The [`manifestStore`](../../js-sdk/api/c2pa.c2pareadresult.manifeststore) object
20
17
-**activeManifest**: A pointer to the latest [`manifest`](../../js-sdk/api/c2pa.manifest) in the manifest store. Effectively the "parent" manifest, this is the likely starting point when inspecting an asset's C2PA data.
21
18
-**validationStatus**: A list of any validation errors the library generated when processing an asset. See [Validation](./validation) for more information.
22
19
23
-
[`Manifest`](../../js-sdk/api/c2pa.manifest) objects contain properties pertaining to an asset's provenance, along with convenient interfaces for [accessing assertion data](../../js-sdk/api/c2pa.assertionaccessor) and [generating a thumbnail](../../js-sdk/api/c2pa.thumbnail). The example in this sandbox demonstrates a basic workflow: reading a sample image, checking for the presence of a manifest store, and displaying the data in the active manifest:
20
+
[`Manifest`](../../js-sdk/api/c2pa.manifest) objects contain properties pertaining to an asset's provenance, along with convenient interfaces for [accessing assertion data](../../js-sdk/api/c2pa.assertionaccessor) and [generating a thumbnail](../../js-sdk/api/c2pa.thumbnail).
This example from the [c2pa-js-examples repo](https://github.com/contentauth/c2pa-js-examples/blob/main/minimal-ts-vite/examples/active-manifest/) demonstrates a basic workflow:
26
25
27
-
The source code for this example is in the [c2pa-js-examples repo](https://github.com/contentauth/c2pa-js-examples/blob/main/minimal-ts-vite/examples/active-manifest/main.ts).
26
+
- Reading an image.
27
+
- Checking for the presence of a manifest store.
28
+
- Displaying the data in the active manifest.
28
29
29
30
This example also features the use of the [`selectProducer`](../../js-sdk/api/c2pa.selectproducer) selector function. See [Selectors](./selectors) for more information.
31
+
32
+
To view and execute this example in a live [code sandbox](https://codesandbox.io/docs/learn/legacy-sandboxes/overview), see [Sandbox: Viewing manifest data](./sandbox-viewing-manifest).
0 commit comments