Nosmai  Effects Nosmai  Moderation Nosmai Try-ons coming soon
Docs menu Web
Reference

Web API reference

Look up the authorized Web 0.2.0 preview lifecycle, camera, package, parameter, compatibility, licensing, and diagnostics APIs.

Platform Web SDK version 0.2.0 developer preview Updated Aug 22, 2026 Time 9 min

Create the SDK

NosmaiWebSDK.create(options) creates and initializes the preview. The options require a target canvas and may include camera, renderer, face tracking, segmentation, licensing, package-loader limits, and callbacks. Use the authorized preview package supplied by Nosmai; no public npm install command is currently documented.

Lifecycle

APIPurpose
initialize()Moves an idle instance to ready state
startCamera(options?)Requests the browser camera and starts the render loop
switchCamera(options)Restarts capture with the requested camera options
pause() / resume()Suspends or resumes rendering without replacing the instance
stopCamera()Stops media tracks and camera rendering
destroy()Releases camera, renderer, package, and inference resources permanently

Packages and parameters

applyEffect(source) accepts an authorized package URL, Blob, ArrayBuffer, or Uint8Array and returns a compatibility-aware result. Inspect compatibility before enabling the effect in production. Use setParameter for a parameter declared by the active package and removeEffect() to unload it.

The preview does not expose native Cloud Filters. Your authorized application supplies the package source and must apply its own access and cache policy.

Runtime state

Read state, version, licenseStatus, runtimeCapabilities, latestFace, latestSegmentation, latestPassTriggers, and diagnostics. Diagnostics reports the selected renderer, inference delegates, timing values, hardware acceleration, and warnings. Do not treat a software renderer as equivalent to a production GPU path.

Licensing

verifyLicense(apiKey) updates the preview license state and watermark. isFeatureEnabled(featureName) reports current entitlement. License rejection does not intentionally destroy the Web preview; observe onLicenseStatus and onDiagnostic and keep keys outside browser source control.

Compatibility limits

Web support is a developer preview. A package may be partially renderable even when its type is generally supported. Treat CompatibilityReport.canRender, fullySupported, pass counts, and issues as the authority for the exact package. Test in the production browser, GPU, iframe, CSP, and camera-permission configuration.

References

Was this page helpful?

Your response helps us prioritize documentation improvements.

Nosmai

An AR and AI company. Founded on the idea that the next decade of software will be visual, and that the tools for it should be within reach of anyone building.

Newsletter

Product updates and release notes. No spam.

© 2026 nosmai, inc · all rights reserved