Skip to main content
SDK 2.0.0. Auth: Auth & License. Enum values: Parameter enums.

Install

Create the engine

EngineConfig on Web has only these fields. There is no appId / appKey on the config object. The SDK loads runtime files during init(). You do not host a site-root resource.fbd for the engine. Optional download progress: init({ onProgress }). The engine does not fetch tokens. Web does not support offline .lic.
Call setLogConfig before init() if you want to see load / auth logs. File logging is not supported in the browser (fileEnabled is ignored).

Skin beauty

Intensity range [0.0, 1.0]. 0 turns the effect off.
setBeautySkinOnly(true) limits smoothing / whitening / sharpening / rosiness to detected skin. Clothing and background stay unchanged.
Style enums: Parameter enums.

Face reshape

Range is [-1.0, 1.0]. 0 is off. Positive and negative are opposite directions (for example FaceThin: slim / fuller cheeks). Full list: Parameter enums.

Body reshape

Range is [0.0, 1.0]. 0 is off. Fetch resource_body.fbd and call addResourcePack after init() first. Full list: Parameter enums. Packs: Optional resource packs.

Makeup

Intensity, shape, and color are separate setters. Intensity is [0.0, 1.0]. Presets: Parameter enums.

Filters and stickers

Pass a .fbd URL or in-memory Uint8Array directly to the setter.
3D stickers need the optional resource_3d.fbd pack (not in the Web SDK). See Optional resource packs. Fetch bytes and register them after init():

Virtual background and chroma key

Chroma key only replaces the mask. Fill is still setVirtualBackgroundBlur or setVirtualBackground. Blur and image replacement are mutually exclusive.

Callbacks

Omit onFaceLandmarks unless you need landmarks. Enabling it runs face detection every frame.

Process frames

Prefer processImage. It returns ImageData synchronously.
input may be ImageData, HTMLImageElement, HTMLCanvasElement, HTMLVideoElement, or Uint8ClampedArray (then width / height are required).
  • FrameType.Video — live camera / streaming (temporal smoothing)
  • FrameType.Image — still photos
processTexture(textureHandle, width, height, stride, frameType, mirrorMode) is for custom GPU texture input. Mirror is not applied on this path. Typical web apps should use processImage.

Stats

Destroy

Call this on page unload or when a React/Vue component unmounts. For TRTC / Agora / LiveKit: Third-party Integration.