Skip to main content

API Overview

The Seenic External API object is created by calling SeenicExternalAPI(iframe) with the target iframe element or a CSS selector string.

Methods

MethodDescription
send(type, payload?)Sends a method call to the iframe. Returns a Promise if the iframe responds.
subscribe(type, callback)Subscribes to a method or event from the iframe. Returns an unsubscribe function.
set(type, payload)Sets API execution settings. Use with setUnitList to map your website unit IDs to Seenic unit IDs so you can use your own IDs in all methods.

Method format

Messages sent to the iframe follow this structure:

{
type: string; // Method or request type
payload?: object; // Optional data
}

Event format

Events from the iframe are delivered to your callback with the payload chosen by the embed (e.g. onMarkerClick).

Full method list

See Methods for the full reference. Summary:

MethodDescription
setUnitListset() — Map website unit IDs to Seenic unit IDs; then use your IDs in other methods
getMarkersListReturns all markers as JSON list
getTourDataReturns tour data (Cycles, Views, Points)
onMarkerClickEvent: marker click (id, type, formularesult, unitId)
setFilteredUnitsSet filtered units to show in player
setFilteredMarkers(TODO) Set filtered markers
locateUnitLocate marker by unit ID
locateMarkerLocate marker by Seenic marker ID (with blink)
setPointSet camera/view to point (from getTourData)
setCycleViewSet active cycle and view
setCycleSet active cycle (standard view)
openUnitCardOpen unit card by unit ID
hideInteractiveElementsPure 3D overview (hide selectables/markers)
captureScreenshotScreenshot 3D scene and download
setFullscreenModeEnter/exit fullscreen
zoomIn / zoomOutZoom scene
setCameraPoseSet camera pose
getAppStateGet global app state
subscribeToAppStateSubscribe to app state heartbeat
setLocationSwitch to location mode by location ID
setDollhouseModeEnable/disable dollhouse mode (value: true/false)
showSpinner / hideSpinner / setSpinnerStateLoading spinner control

Example

const api = SeenicExternalAPI('#seenic-player');

// 1) Map your unit IDs to Seenic IDs (do once when player is ready)
api.set('setUnitList', {
'my-internal-id-1': 'seenic-unit-abc',
'my-internal-id-2': 'seenic-unit-def',
});

// 2) Use your IDs in methods
api.send('locateUnit', { unitId: 'my-internal-id-1' });
await api.send('setPoint', { pointId: 3 });

// 3) Listen for events
api.subscribe('ready', () => console.log('Seenic player is ready'));
api.subscribe('subscribeToAppState', (data) => console.log('App state:', data));