How contentauth/c2pa-js-examples works
Project type and purpose
• This is a monorepo of self-contained front-end example/demo applications for the c2pa-js SDK.
• It is managed by Rush.js to enable automatic workspace linking and consistent scripting across multiple example “packages.”
• Each subfolder (esm-imports, minimal-ts-rollup, minimal-ts-vite, minimal-ts-webpack, react-ts-vite) is a standalone demo showing how to integrate c2pa-js with various build tools (ESM imports, Rollup, Vite, Webpack, React+Vite).
File structure
• Top-level files:
• CONTRIBUTING.md, LICENSE, README.md (monorepo metadata)
• “esm-imports”, “minimal-ts-rollup”, “minimal-ts-vite”, “minimal-ts-webpack”, “react-ts-vite” (Rush workspaces)
• Each workspace has:
• package.json (defines scripts, dependencies on c2pa-js SDK)
• configuration for its bundler (rollup.config.js, vite.config.js, webpack.config.js)
• a small src or example folder with TypeScript/HTML entrypoints
• dev server entry (index.html) and build output location
• Rush config under each workspace’s .rush/temp shows that Rush orchestrates build, linking, and installs.
README for additional insights
• The README reiterates that these are examples managed by Rush.
• It refers to a higher-level documentation guide for using the SDK.
• There is no global backend or database—each example is purely client-side.
a. Main components
• Rush monorepo root
• Workspace manager (Rush.js)
• Individual example packages (5)
– esm-imports
– minimal-ts-rollup
– minimal-ts-vite
– minimal-ts-webpack
– react-ts-vite
• Bundler toolchains (Rollup, Vite, Webpack)
• c2pa-js SDK (as a shared dependency)
• Dev servers / static file servers (per example)
• NPM registry / package store (external)
b. Relationships and interactions
• Rush orchestrates “rushx build” / “rushx start” across all workspaces
• Each workspace pulls in c2pa-js from the monorepo link or NPM
• Bundler compiles TypeScript → JavaScript, injects c2pa-js usage, emits static HTML+JS
• Dev server hosts the built files in browser for interactive demos
c. Architectural patterns/design principles
• Monorepo with workspace linking for zero-version skew across examples
• Polyrepo-style isolation at the workspace level for toolchain experiments
• Reuse of the same core SDK package across multiple build configurations
d. Key technologies/frameworks
• Rush.js for monorepo management
• TypeScript for source code
• Rollup, Webpack, Vite as bundler/dev-server frameworks
• React (in react-ts-vite example)
• ESM imports (in esm-imports example)
Elements
• Clear labels: “Rush Monorepo”, each “Example Package” by name, “c2pa-js SDK”
• From Rush → each workspace (orchestration)
• From workspaces → c2pa-js SDK (dependency resolution)
• From workspaces → Bundler tool (Rollup/Vite/Webpack)
• From Bundler → Dev Server → Browser
• From workspaces → NPM Registry (external fetch)
• Another for example packages and their pipelines