npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

c2pa-react-cawg-component

v0.1.13

Published

A React plugin for c2pa-react-component that renders Creator Assertions Working Group (CAWG) data — identity credentials, metadata, and training permissions.

Downloads

401

Readme

c2pa-react-cawg-component

A plugin for c2pa-react-component that renders CAWG (Creator Assertions Working Group) manifest data — including author, publisher, and the full stds.schema-org.CreativeWork assertion — at three progressive levels of detail.

Requirements

This package is a plugin for c2pa-react-component. Install both:

npm install c2pa-react-cawg-component c2pa-react-component

Peer dependencies

| Package | Version | |---|---| | react | ^18.0.0 \|\| ^19.0.0 | | react-dom | ^18.0.0 \|\| ^19.0.0 |

CSS

Import the stylesheet once at the root of your app:

import "c2pa-react-cawg-component/style.css";

Next.js App Router — add it to app/layout.tsx:

import "c2pa-react-cawg-component/style.css";

export default function RootLayout({ children }: { children: React.ReactNode }) {
  return (
    <html>
      <body>{children}</body>
    </html>
  );
}

Usage

Pass CAWGManifest as a plugin to the C2paManifest component from c2pa-react-component:

import { C2paManifest } from "c2pa-react-component";
import { CAWGManifest } from "c2pa-react-cawg-component";
import type { VerificationOutcome } from "c2pa-react-component-types";
import "c2pa-react-cawg-component/style.css";

export function MediaCard({ outcome }: { outcome: VerificationOutcome }) {
  return (
    <C2paManifest
      manifest={outcome}
      plugin={[CAWGManifest]}
    />
  );
}

Component

CAWGManifest

Renders CAWG creator assertion data from a C2PA manifest at a configurable level of detail.

import { CAWGManifest } from "c2pa-react-cawg-component";

<CAWGManifest manifest={verificationOutcome} level={1} />

Props

| Prop | Type | Default | Description | |---|---|---|---| | manifest | VerificationOutcome | required | Verification result from the C2PA SDK | | level | 1 \| 2 \| 3 | 1 | Initial disclosure level | | className | string | — | CSS class applied to the root element |

Disclosure levels

| Level | What is shown | |---|---| | 1 | Compact card: title, claim generator (thumbnail or initials badge), "More Info" button | | 2 | Extends level 1 with author and publisher from the stds.schema-org.CreativeWork assertion | | 3 | Full stds.schema-org.CreativeWork assertion — all present Schema.org fields rendered as key/value pairs |

Clicking "More Info" advances from level 1 → 2 → 3. Clicking "Small View" at level 3 returns to level 1.

Trust registry (TRQP)

Level 2 and level 3 render a TrustBadge next to verified identities, showing whether the manifest's issuer is recognized by a TRQP trust registry.

This package does not ship a mock or default trust registry. Out of the box, the badge will always report "Unable to reach trust registry" — you must configure a real query function that calls your TRQP endpoint (or any equivalent authorization check).

setTrustRegistryQueryFn

Call once at app startup to configure the query function used by every TrustBadge in your app:

import { setTrustRegistryQueryFn } from "c2pa-react-cawg-component";
import type { TrqpAuthorizationResponse } from "c2pa-react-cawg-component";

setTrustRegistryQueryFn(async ({ entityId, action, resource }): Promise<TrqpAuthorizationResponse> => {
  const res = await fetch(
    `https://your-trqp-endpoint.example.com/registries/main/entities/${entityId}/authorization/${action}/${resource}`,
  );
  if (!res.ok) throw new Error(`TRQP query failed: ${res.status}`);
  return res.json();
});

If no query function is configured, every TrustBadge throws and renders an error state instead of silently reporting a false result.

Per-badge override

TrustBadge (used internally by CAWGManifest at levels 2–3) also accepts a queryFn prop directly, which takes precedence over the app-wide default set via setTrustRegistryQueryFn.

TrustRegistryQueryFn

type TrustRegistryQueryFn = (params: {
  entityId: string;
  action?: string;
  resource?: string;
}) => Promise<TrqpAuthorizationResponse>;

Types

Types are provided by the shared c2pa-react-component-types package, which is installed automatically as a dependency.

import type {
  VerificationOutcome,
  Manifest,
  ManifestStore,
  PluginC2PA,
} from "c2pa-react-component-types";

This package also exports its own TRQP-related types — see Trust registry (TRQP) above.

Local development

Use yalc to consume the library in another local project without publishing to npm.

Install yalc globally (once):

npm install -g yalc

Start watch mode in this repo:

# Terminal 1 — rebuild on every save
npm run dev:lib

# Terminal 2 — push updates to yalc's local store
yalc push --watch

In your consuming project:

yalc add c2pa-react-cawg-component
npm install

Revert to the published npm version:

yalc remove c2pa-react-cawg-component
npm install

License

MIT