Media & Export Events
Media and export events track PDF generation, image export, 3D model export, and AR (Augmented Reality) code generation. These events are useful for showing loading states during export operations, tracking which export formats users prefer, and integrating export actions with external systems.
PDF Export Flow
User clicks Generate PDF (or action.showExportPDF() called)
│
▼
mimeeq-show-export-pdf-modal ← modal opens, user selects content
│
▼
User clicks Generate
│
▼
mimeeq-pdf-generate-start ← generation begins
│
▼
(PDF rendered server-side)
│
▼
(PDF export hooks, if configured)
│
▼
mimeeq-pdf-generate-done ← attempt finished; check success
3D Model Export Flow
All 3D model exports (GLB, OBJ, STL, USDZ) follow the same event pattern. The format-specific logic is handled internally — the events are format-agnostic.
User clicks export (or actions.exportGlb() / exportObj() / exportStl() / exportUsdz())
│
▼
mimeeq-3d-before-export-scene ← export starts, scene is being processed
│
▼
(model exported and packaged)
│
▼
mimeeq-3d-after-export-scene ← file ready, download initiated
Image Export Flow
User clicks save image (or actions.saveImage() / actions.showExportImageModal())
│
▼
mimeeq-3d-before-export-image ← screenshot capture begins
│
▼
(image rendered from current camera angle)
│
▼
mimeeq-3d-after-export-image ← image ready, download initiated
Events
PDF
mimeeq-show-export-pdf-modal
The PDF export modal was opened. The user can select which tabs/content to include in the generated PDF. This fires whether the modal was opened by the user clicking the PDF button or by calling mimeeqApp.actions.showExportPDF() programmatically.
Payload: none
mimeeq-pdf-generate-start
PDF generation has started. The configurator is collecting content (screenshots, option data, pricing) and sending it to the server for rendering. Use this to show a loading indicator — PDF generation can take several seconds depending on content complexity.
Triggered by: actions.generateProductPDF()
Payload: none
mimeeq-pdf-generate-done
An eligible PDF export attempt has finished. Use this event to hide loading state; inspect success before counting a successful export. It fires once after PDF export hooks and delivery finish, including hook fallbacks, suppressed downloads, preparation errors, thrown custom PDF failures, and empty built-in output.
success: true means a valid PDF URL was returned and either the browser download was initiated or a hook confirmed the handoff (handleExport returned { completed: true }, or processFile returned undefined/void). success: false means the attempt failed or handleExport timed out without confirming a handoff. A timeout still suppresses the download because the host may complete its work later. This event does not prove the file was saved to disk or that a host integration's background delivery has finished.
A custom getPdfContent callback that resolves with no HTML (normally '') retains the legacy handoff: it owns the download and completion notification. Mimeeq does not add a completion or infer failure from that empty return. Such integrations may emit the legacy event without a success payload. If a custom callback throws, Mimeeq emits { success: false } and preserves the rejection.
Attempts with no product or with multiple selected modular products return early without start/done events. Completion reporting preserves existing error propagation; callers should still handle rejected generation promises.
Triggered by: actions.generateProductPDF()
Payload: PdfGenerateDoneEventPayload
| Field | Type | Description |
|---|---|---|
success | boolean | Download initiated or hook handoff confirmed (true); failure or unconfirmed takeover timeout (false) |
// Show a loading overlay during PDF generation
document.addEventListener('mimeeq-pdf-generate-start', () => {
document.getElementById('pdf-loader').style.display = 'flex';
});
document.addEventListener('mimeeq-pdf-generate-done', (event) => {
document.getElementById('pdf-loader').style.display = 'none';
if (event.detail?.success === true) {
analytics.track('pdf_exported');
} else if (event.detail?.success === false) {
showPdfError();
}
});
3D Model Export
These events fire for all 3D model exports: GLB (with optional compression), OBJ, STL, and USDZ. They wrap the entire export process — from scene serialization through file packaging to download. The events do not indicate which format was exported; if you need to track that, wrap the programmatic actions.exportGlb() / exportObj() / exportStl() / exportUsdz() calls with your own tracking.
mimeeq-3d-before-export-scene
A 3D model export has started. The scene is being serialized and packaged into the target format. This can take several seconds for complex scenes.
Triggered by: actions.exportGlb(), actions.exportUsdz(), actions.exportStl(), or actions.exportObj().
Payload: none
mimeeq-3d-after-export-scene
The 3D model export is complete and the file download has been initiated.
Triggered by: actions.exportGlb(), actions.exportUsdz(), actions.exportStl(), or actions.exportObj().
Payload: none
// Track 3D model exports
document.addEventListener('mimeeq-3d-before-export-scene', () => {
document.getElementById('export-loader').style.display = 'flex';
});
document.addEventListener('mimeeq-3d-after-export-scene', () => {
document.getElementById('export-loader').style.display = 'none';
analytics.track('3d_model_exported');
});
Image Export
These events fire when the user saves a product image via the image export modal or when mimeeqApp.actions.saveImage() is called programmatically. The image is rendered from the current camera angle at the requested resolution.
mimeeq-3d-before-export-image
Image capture has started. A screenshot is being taken from the current 3D viewport.
Triggered by: actions.saveImage()
Payload: none
mimeeq-3d-after-export-image
The image has been captured and the download has been initiated.
Triggered by: actions.saveImage()
Payload: none
// Custom image export with loading state
document.getElementById('save-image-btn').addEventListener('click', async () => {
const loader = document.getElementById('image-loader');
loader.style.display = 'flex';
// The after-export event fires when the download starts
document.addEventListener(
'mimeeq-3d-after-export-image',
() => {
loader.style.display = 'none';
},
{ once: true },
);
await window.mimeeqApp.actions.saveImage('png', 2048);
});
AR (Augmented Reality)
mimeeq-generate-ar-short-code
An AR short code was generated for the current configuration. This fires when the user requests an AR experience — the short code is used to load the configured product in AR on a mobile device.
Triggered by: actions.generateAR()
Payload: GenerateArShortCodeEventPayload
| Field | Type | Description |
|---|---|---|
shortCode | string | Short code for the AR experience |
allowScaling | boolean | Whether the AR model can be scaled by the user |
document.addEventListener('mimeeq-generate-ar-short-code', (event) => {
const { shortCode, allowScaling } = event.detail;
// Build a QR code linking to the AR experience
const arUrl = `https://ar.mimeeq.com/${shortCode}`;
generateQRCode(arUrl, document.getElementById('ar-qr'));
analytics.track('ar_code_generated', { shortCode, allowScaling });
});
mimeeq-ar-modal-opened
The desktop AR QR-code modal opened after an AR short code was generated. This event describes the modal opening, not a completed AR session. On mobile, the normal flow launches the AR landing page instead and does not emit this modal event.
Payload: ArModalOpenedEventPayload
| Field | Type | Description |
|---|---|---|
action | 'arModelOpened' | Action identifier |
shortCode | string | AR configuration short code |
allowScaling | boolean | Whether the AR model allows scaling |
embedInstanceId | string | Embed instance that opened the modal |
document.addEventListener('mimeeq-ar-modal-opened', (event) => {
const { shortCode, allowScaling, embedInstanceId } = event.detail;
analytics.track('ar_qr_modal_opened', { shortCode, allowScaling, embedInstanceId });
});
mimeeq-ar-get-back-to-configuration
The user clicked the "Edit" button on the AR landing page to return to the configurator. The payload contains the configuration context from the AR session, which can be used to verify the correct product state is restored.
Payload: ArGoBackEventPayload
| Field | Type | Description |
|---|---|---|
action | string | Action identifier, always 'arGoBack' |
variantCode | string | Variant code of the product that was being viewed in AR |
shortCode | string | Short code of the configuration that was in AR |
isModular | boolean | Whether the product is modular |
document.addEventListener('mimeeq-ar-get-back-to-configuration', (event) => {
const { variantCode, shortCode, isModular } = event.detail;
// Restore configurator UI if it was hidden during AR
document.getElementById('configurator-wrapper').style.display = 'block';
document.getElementById('ar-overlay').style.display = 'none';
analytics.track('ar_exit_to_configurator', { variantCode, shortCode, isModular });
});
Related
- Actions — Exporters — programmatic export methods (
exportGlb,exportObj,exportStl,exportUsdz,saveImage,showExportPDF) - Icons Customization — Export & Document Operations — customizing export-related icons