Prerequisites
- A working Web quickstart
- A Web-compatible AR mask available through Cloud Filters
Download and apply the mask
Use the URL returned for the selected Web-compatible Cloud Filter:
const maskUrl = selectedCloudFilter.downloadUrl;
const result = await sdk.applyEffect(maskUrl);
if (!result.success) {
throw new Error(result.error ?? 'AR mask could not be applied');
}
The mask handles face tracking and its configured trigger behaviour. The Web preview does not expose application-level raw face landmarks.
Verify it worked
Test face loss, return, head rotation, camera permission restart, and browser tab visibility changes.
Common errors
| Symptom | Fix |
|---|---|
| Cloud Filter request fails | Check static path, HTTPS, CORS, and Content Security Policy |
| Mobile filter is rejected | Use a Cloud Filter marked as compatible with the Web preview |
| Camera does not restart | Stop previous tracks and request a new stream from a user gesture |