live2d-web documentation

Model inspection

Check URLs and local model zip files before loading.

Inspect before rendering

The optional inspect entry checks model3 references without importing React, Core, Framework, MediaPipe or JSZip. Content problems return together as findings; invalid API arguments and abort reject.

import {
  inspectModelCapabilities,
  inspectModelSource,
} from 'live2d-web/inspect'
 
const report = await inspectModelSource({
  src: 'https://example.com/model.model3.json',
})
 
if (report.status === 'compatible') {
  console.log(report.motions, report.expressions)
}

URL mode fetches HTTP(S) references declared by the model. Browsers enforce CORS, but a Node server has no browser CORS or private-network boundary. If a server accepts untrusted model URLs, put a host allow-list and network policy in front of inspection. The library does not guess which private IP ranges your server may access. Resolver-backed local inspection never fetches an external URL declared by the archive.

Browser zip inspector

The /inspect tool opens a zip only in the current tab. It validates size, count, paths and model references, and never uploads, stores or sends telemetry. Incompatible archives are not rendered.

Interpret the report

compatible has no findings, warning can be reviewed before rendering, and incompatible contains at least one error. Inspect asset paths and types together: a model3 file may parse correctly while its moc3, texture or motion is missing. Capability results describe available Standard channels and whether at least 45 of 52 Perfect Sync parameters match.

Set limits and cancellation

Use lower maxAssetBytes, maxTotalBytes and maxReferences values when inspecting user-controlled sources. Pass an AbortSignal when navigation or model selection can replace the request. Abort rejects; ordinary model-content problems stay in the report so the UI can show all findings in one pass.