@elarontech/sdk-core
v0.16.0
Published
Platform-agnostic Elaron client.
Readme
@elarontech/sdk-core
Platform-agnostic client for the Elaron platform API, by Elaron Technologies LLC.
Runtime requirements
The client relies on fetch, AbortSignal.timeout(), AbortSignal.any(), and WebCrypto Ed25519 (token verification).
| Runtime | Minimum | |---|---| | Node.js | 22 | | Electron | 42 | | Cloudflare Workers | supported | | Chrome / Edge | 137 | | Firefox | 129 | | Safari | 17.4 |
Licensing
const client = createClient({ baseUrl: 'https://api.elarontech.com', productId: 'videowall', appVersion })
const license = createLicenseManager({ client, storage, publicKeys: ELARON_PUBLIC_KEYS })
license.subscribe((s) => render(s)) // state, lock reason or token changed
license.start() // auto refresh: at refresh_at, with backoff while offline; call again after system resume
await license.activate(userInput, device)status() works offline and returns none | active | grace | locked. active and grace include
expires_at (null for lifetime), remaining_seconds (computed from a rollback-checked clock), refresh_at
and offline_until. storage is platform-specific (@elarontech/sdk-electron provides an encrypted one).
One manager per storage key: state writes are serialized, and a network result is dropped if the stored license changed while the request was in flight.
Ship the public key with the app (pnpm ops keys-export in the platform repo). It is the only key used to verify
tokens: nothing is fetched or read from storage, because a key the device owner can replace would let them forge any
license.
Client version policy
Activation, refresh and trial responses may carry a version policy for this product and platform (configured in
the platform admin). manager.clientPolicy() returns it offline with update_required / update_available
(compared with appVersion) and notices; subscribeClient() reports changes. The SDK never blocks the app —
deciding what to do is up to you.
Website links
websiteLinks({ websiteUrl, productId, medium, licenseId }) returns the buy page and the renewal page (tagged
utm_source=app; licenseId opens that license directly) and the key recovery page. Open them in the system browser.
Expired licenses can still be activated (status locked, reason EXPIRED) and keep refreshing hourly, so a renewal
unlocks them without re-entering the key.
Errors
All failures are thrown as ElaronError (check with isElaronError(err), not instanceof).
Client-side codes: NETWORK, TIMEOUT, ABORTED, INVALID_RESPONSE, INVALID_CONFIG, LICENSE_PRESENT
(startTrial() while a license is stored; deactivate or clear first).
Server codes are passed through as-is; treat unknown codes as retryable failures.
https://elarontech.com
