Skip to main content
SDK 2.0.0. Auth failures: Auth & License.
Failed calls throw FacebetterError. Numeric code values are listed below. Some load / auth failures use a string code instead.

Numeric codes

JavaScript-layer codes (string)

These are thrown during init() / load / auth:

Init checklist

  1. Config is valid: non-empty licenseToken.
  2. The SDK can download its runtime files (facebetter-core package, or files next to the UMD script).
  3. Page is a secure context.
  4. Dashboard domain matches the page origin (production).
  5. Production does not embed appKey in frontend JS.

Parameter and process errors

Beauty intensities must be [0.0, 1.0]. Reshape must be [-1.0, 1.0]. Out of range throws FacebetterError before the native call. processImage throws if the engine is not initialized, buffers cannot be allocated, or the native process returns a non-zero status. Validate video readyState and non-zero videoWidth / videoHeight before calling. Empty filter / sticker / background paths are rejected; use clearFilter(), clearSticker(), or clearVirtualBackground().

Engine events vs exceptions

Auth / init can also arrive on onEngineEvent (EngineEventCode 0 / 1 / 100 / 101) after init() has already resolved. Listen for LicenseValidationFailed and InitializationFailed even if init() did not throw.