What's New?
WebAR SDK v2.1.0
Last updated
WebAR SDK v2.1.0
Release Date: January 2026
Face Tracking Lifecycle Callbacks
Monitor face detection state in real-time with new callback APIs.
New APIs:
SetFaceFoundCallback(callback) - Fires when a face is detected
SetFaceLostCallback(callback) - Fires when a face is lost
IsFaceTracked() - Check if face is currently tracked
GetFaceTrackingState() - Get current state ('FOUND' or 'LOST')
RemoveFaceFoundCallback(callback) / RemoveFaceLostCallback(callback) - Remove callbacks
Usage:
WEBARSDK.SetFaceFoundCallback((faceInfo) => {
console.log('Face detected!');
showARContent();
});
WEBARSDK.SetFaceLostCallback(() => {
console.log('Face lost!');
hideARContent();
});
if (WEBARSDK.IsFaceTracked()) {
// Face is currently visible
}Key Features:
Callbacks fire on state transitions (not every frame)
Built-in debouncing to prevent flickering
Access to face position, rotation, scale, and mouth openness
Late registration support - callbacks fire immediately if face already tracked
Tracking Status API (Surface & World Tracking)
Query the current tracking state for Surface and World Tracking modes.
New API:
GetTrackingStatus() - Returns current tracking state
Usage:
Tracking States:
0 - Idle
1 - Anchoring/Initialising
2 - Tracking (active)
3 - Relocalising
Windows Touchscreen Laptop Detection
Fixed device detection for Windows touchscreen laptops (Microsoft Surface Pro, Surface Laptop, etc.). These devices are now correctly identified as desktop devices, preventing unwanted motion sensor permission prompts.
CSS Framework Compatibility (Face Tracking)
Fixed face tracking compatibility with CSS frameworks like Tailwind and Bootstrap. The SDK now properly handles aspect ratio constraints, preventing horizontally stretched faces and improving tracking accuracy.
Gyro Initialization
Improved gyro sensor initialization for more reliable tracking startup.
Last updated
const info = WEBARSDK.GetTrackingStatus();
if (info) {
console.log('Status:', info.status); // "Tracking", "Anchoring", etc.
console.log('State:', info.state); // 0-3
console.log('Is Tracking:', info.isTracking); // true/false
}