Appearance
Preset schemas
Viewer preset
json
{
"schema": "3d-model-lab/v2",
"asset": { "name": "product.glb", "fileBytes": 123456 },
"viewer": {},
"materials": []
}Validate unknown data:
ts
const preset = parseViewerPreset(input)isViewerExportPayload(input) performs a boolean type guard; parseViewerPreset(input) throws when the schema is unsupported.
Standalone sequence
json
{
"schema": "3d-model-lab-sequence/v1",
"asset": "product.glb",
"sequence": {}
}Use isSequencePayload or parseSequencePayload at trust boundaries.
Versioning policy
A schema version changes when stored data becomes structurally incompatible. Package version changes do not necessarily require a schema change. Migration should happen before rendering, not inside the animation loop.