Simplio3D

Augmented Reality (AR) SDK

SDK helpers for AR file management, analytics tracking, and programmatic AR launches.

Upload USDZ File

// Upload a USDZ file for iOS AR Quick Look
const usdzFile = document.querySelector('input[type="file"]').files[0];
const result = await client.projects.uploadUsdz('PROJECT_ID', usdzFile);
console.log(result.usdzId, result.usdzPath);

// Then update project settings:
await client.projects.updateSettings('PROJECT_ID', {
  enableAR: true,
  arUsdzFileName: result.fileName,
  arUsdzModelPath: result.usdzPath,
  arUsdzModelId: result.usdzId,
  arAutoLaunch: true,
  arAnalyticsEnabled: true,
});

Track AR Events

import { trackAREvent } from './lib/ar-analytics';

// Track an AR event (fire-and-forget, non-blocking)
trackAREvent({
  event: 'ar_launch_ios',
  projectId: 'PROJECT_ID',
  meta: { source: 'floating_tools' },
});

// Available event types:
// 'ar_dialog_open'    — Desktop QR dialog opened
// 'ar_qr_copy'        — AR link copied
// 'ar_qr_open_tab'    — AR link opened in new tab
// 'ar_launch_ios'     — iOS AR Quick Look launched
// 'ar_launch_android' — Android Scene Viewer launched
// 'ar_auto_launch'    — Auto-launched via ?ar=1
// 'ar_page_view'      — Share page loaded with AR

Fetch AR Analytics

import { fetchARAnalytics } from './lib/ar-analytics';

const analytics = await fetchARAnalytics('PROJECT_ID', accessToken);
console.log(analytics.totalEvents);     // 142
console.log(analytics.byEvent);          // { ar_launch_ios: 41, ... }
console.log(analytics.recentEvents);     // last 50 events

Programmatic AR Launch

// Generate an AR share URL
const shareUrl = `https://yourapp.com/share/${projectId}/${token}`;
const arUrl = `${shareUrl}?ar=1`;

// On iOS — use USDZ with AR Quick Look
const link = document.createElement('a');
link.setAttribute('rel', 'ar');
link.href = usdzSignedUrl; // from /share/:projectId/usdz
const img = document.createElement('img');
img.style.display = 'none';
link.appendChild(img);
document.body.appendChild(link);
link.click();

// On Android — use Scene Viewer intent
const intent = `intent://arvr.google.com/scene-viewer/1.0
  ?file=${encodeURIComponent(glbUrl)}
  &mode=ar_preferred#Intent;...;end;`;
window.location.href = intent;

Continue reading