Skip to main content

DeepAR for Web

Web SDK

DeepAR for Web is a Javascript and Typescript library optimized for browsers.

The library consists of 3 main components

  1. deepar.js (UMD) and deepar.esm.js (ES6 module) - The user facing API. Call initialize to get the DeepAR object for interacting with the SDK. By default, DeepAR will use the front webcam as input source. The output will be rendered onto the canvas which can be inserted into the DOM or transformed into a MediaStream for WebRTC streaming. DeepAR has screenshot and video recording API out-of-the-box. Load AR effects with switchEffect.
  2. deepar.wasm - The core DeepAR SDK that is shared across all the platforms compiled from C++ to WebAssembly. The wasm code is internally called by the JS library and users do not directly interact with it. Core SDK handles all the rendering and ML logic.
  3. ML models - Used to track various human body features such as face, feet and wrist. ML models are packaged analogised the JS code and are lazy-loaded only when needed by the SDK. Users do not interact directly with them. This part contributes the most to the overall library size. But since components are lazy loaded on demand, the complete download size of the SDK depends on the use-case.