Skip to main content
SDK 2.0 authenticates with a license token. Native platforms can also use appId + appKey for online auth. Web must never embed appKey in frontend JavaScript.
Complete Subscription first: bind your app identifiers in the Dashboard (Bundle ID / package name / domain) and enable a plan.

Native (Android / iOS / macOS / Windows)

Pass one of the following when creating the engine: Priority: if licenseToken is non-empty, the SDK validates that token locally and does not call the network with appId / appKey.
Recommended (same idea as Web): keep appId / appKey on your server, mint a short-lived licenseToken, and deliver it to the app. Set platform in the signed request to match the client (ios / android / macos / windows). See Web → Server proxy below. Direct appId + appKey and offline .lic remain supported.
iOS / macOS
Android
C++ (Windows)
Online alternative on native platforms:
Prefer shipping the offline .lic as an app asset and loading it at runtime instead of hard-coding it in source. How to obtain one: Offline license below.

Web

The browser SDK has no appId / appKey fields. The engine only accepts licenseToken and verifies it locally. Fetch the token from your server before init().
  1. Create an app in the Dashboard, bind your Web domain, and copy appId / appKey (see Subscription)
  2. Keep the keys on your backend; expose an endpoint (for example POST /api/facebetter/auth)
  3. Your backend signs a request to https://facebetter.pixpark.net/facebetter/v2/auth and returns the raw response body to the page
  4. Pass that string to EngineConfig.licenseToken, then call init()
The official demo (demo/web/react) uses the same pattern: frontend in src/fetchLicenseToken.js, server proxy in api/facebetter/auth.js.
Do not put appKey in a frontend bundle. An offline .lic on the web must match the page origin, for example https://app.example.com. Electron does not check origin. Online tokens expire in minutes — fetch a new one before creating the engine again.

Frontend

Server proxy (Node example)

Store FB_APP_ID / FB_APP_KEY in environment variables. Drop this into Express / Fastify / a serverless function:
In other languages, implement the same steps: build the sign string → HMAC-SHA256 (hex) → POST upstream → hand the body to the frontend. Runnable reference: GitHub Demo api/facebetter/auth.js.

Upstream request fields

On success the upstream returns JSON (including a token field). You may forward the response text as-is, or extract only the token string — the SDK accepts either.

Offline license

Download an offline .lic from the Dashboard credentials page and pass the entire contents as licenseToken / license_token. Paid plans lock each saved identifier. An empty platform can be filled once. To change a locked identifier, contact support. Free plans can edit identifiers and download anytime. The file expires 15 days after the subscription ends. Downloading again does not move that date. After renewal, download a new file.

Notes

  • Online tokens and offline licenses both check the Dashboard app identifier: iOS and macOS use the Bundle ID, Android uses the package name, Windows and Linux use the executable file name, and a browser uses the page origin. Electron does not check origin. A mismatch fails validation.
  • Not expired: features follow your subscription plan.
  • Expired: the engine can still initialize, but capabilities fall back to the Free plan (watermarked trial). After renewal, download a new file from the Dashboard.
  • Web offline licenses are bound to the page origin. Pass the entire .lic as licenseToken.

Engine events

Listen for license and init results via onEngineEvent: