Skip to main content

Reading manifest data

note

That JavaScript library is being extensively revised so the APIs used here may change in the near future.

Use c2pa.read to read manifest data from an asset; if the asset has a C2PA manifest and was processed without errors, the returned c2paReadResult contains a manifestStore object with several useful properties:

  • manifests: An object containing all the asset's manifests (Manifest objects), keyed by UUID.
  • activeManifest: A pointer to the latest manifest in the manifest store. Effectively the "parent" manifest, this is the likely starting point when inspecting an asset's C2PA data.
  • validationStatus: A list of any validation errors encountered. See Validation for more information.
  try {
// Read in image and get a manifest store
const { manifestStore } = await c2pa.read(sampleImage);
console.log('manifestStore', manifestStore);

// Get the active manifest
const activeManifest = manifestStore?.activeManifest;
console.log('activeManifest', activeManifest);
} catch (err) {
console.error('Error reading image:', err);
}
})();