3D Viewer
Embed and control the 3D viewer. Manage camera, lighting, state, and take screenshots.
Get Embed Config
const config = await client.getViewerEmbedConfig('proj_123');
console.log('Camera:', config.cameraPosition);
console.log('Environment:', config.environmentPreset);
console.log('AR enabled:', config.enableAR);Get Viewer State
const state = await client.getViewerState('proj_123');
console.log('Loaded:', state.loaded);
console.log('Selections:', state.selections);
console.log('Visible blocks:', state.visibleBlocks);
console.log('Price:', state.currentPrice?.totalPrice);Set Viewer State
const newState = await client.setViewerState('proj_123', {
loaded: true,
selections: {
dropdownSelections: { 'blk_frame': 'silver' },
selectMaterialSelections: {},
checkboxSelections: {},
toggleSwitchSelections: {},
carouselSelections: {}
},
visibleBlocks: ['blk_001', 'blk_002'],
cameraPosition: [3, 2, 5],
cameraTarget: [0, 0.5, 0]
});Continue reading
AnimationsCreate and play animation blocks: move, rotate, float, scale-pulse, swing, and orbit.Project SettingsRead and update the 140+ project settings covering display, branding, AR, e-commerce, email, and PDF.AssetsUpload, list, update, and delete 3D model, texture, and image assets.MaterialsCreate and manage PBR materials and their texture maps.
