License key created on DeepAR developer portal for your web app.
Canvas element where DeepAR will render the camera and effects/filters.
Optional effectThe URL of a DeepAR effect file. This effect will be applied when DeepAR is initialized. This parameter is optional. You can always later switch to a different effect with switchEffect.
Optional rootPath to the root directory of the DeepAR SDK. This path will be used to locate and download all the additional needed files like ML models and wasm files.
By default, this points to the JsDelivr CDN. For example "https://cdn.jsdelivr.net/npm/deepar@5.0.0/".
If you want to host the DeepAR SDK yourself set the path to it here. It is recommended to host DeepAR SDK on your own since then you can use compressions like gzip and brotli on the files.
⚠️ Be sure that the version of DeepAR js file and the root SDK path match!
DeepAR SDK can be hosted on any other server, but be sure not to change the directory and file structure of DeepAR SDK when hosing it.
To configure usage of non-default ML models, define them in the additionalOptions.
Optional additionalAdditional DeepAR options.
Optional cameraCamera options. DeepAR will use the camera by default.
Optional disableIf true, DeepAR will not use camera preview by default and all the other options here are ignored in that case. You can use your own camera/video by calling setVideoElement or start the camera at any time by calling startCamera
Optional facingCan be "user" or "environment". User will be a front facing camera on mobile devices, while environment will be the back facing camera. Default is "user".
Optional cameraCalled when the camera permission is asked.
Optional cameraCalled when the camera permission is granted.
Optional hint?: string | string[]Provide a hint or hints to DeepAR to optimize the SDK in some scenarios. 
Available hints:
Optional faceFace tracking module path and options.
Path to the face tracking model. Something like "path/to/deepar/models/face/models-68-extreme.bin".
Optional segmentationSegmentation module path and options.
Path to the segmentation model. Something like "path/to/deepar/models/segmentation/segmentation-192x192.bin".
Optional footFoot tracking module paths and options.
Optional posePath to the pose libPoseEstimation.wasm file, e.g. "/path/to/deepar/wasm/libPoseEstimation.wasm".
Optional detectorPath to the detector model, e.g. "/path/to/deepar/models/foot/foot-detector.bin".
Optional trackerPath to the tracker model, e.g. "/path/to/deepar/models/foot/foot-tracker.bin".
Optional objPath to the foot model object file, e.g. "/path/to/deepar/models/foot/foot-model.obj".
Optional tfjsPath to tfjs-backend-wasm.wasm file, e.g. "path/to/deepar/wasm/tfjs-backend-wasm.wasm"
Optional tfjsPath to tfjs-backend-wasm-simd.wasm file, e.g. "path/to/deepar/wasm/tfjs-backend-wasm-simd.wasm"
Optional tfjsPath to tfjs-backend-wasm-threaded-simd.wasm file, e.g. "path/to/deepar/wasm/tfjs-backend-wasm-threaded-simd.wasm"
Optional wristFoot tracking module paths and options.
Optional posePath to the pose libPoseEstimation.wasm file, e.g. "/path/to/deepar/wasm/libPoseEstimation.wasm".
Optional detectorPath to the detector model, e.g. "/path/to/deepar/models/foot/foot-detector.bin".
Optional trackerPath to the tracker model, e.g. "/path/to/deepar/models/foot/foot-tracker.bin".
Optional objPath to the foot model object file, e.g. "/path/to/deepar/models/foot/foot-model.obj".
Optional tfjsPath to tfjs-backend-wasm.wasm file, e.g. "path/to/deepar/wasm/tfjs-backend-wasm.wasm"
Optional tfjsPath to tfjs-backend-wasm-simd.wasm file, e.g. "path/to/deepar/wasm/tfjs-backend-wasm-simd.wasm"
Optional tfjsPath to tfjs-backend-wasm-threaded-simd.wasm file, e.g. "path/to/deepar/wasm/tfjs-backend-wasm-threaded-simd.wasm"
Optional deeparPath to deepar.wasm file. Something like "/path/to/deepar/wasm/deepar.wasm".
Generated using TypeDoc
Parameters for the initialization of DeepAR object.