SDK reference map
Find SDK methods, return values and the relevant integration guides.
On this page
Import the SDK with import llvls from '@llvls/sdk' in your Studio project. The Studio provides it. Use the full Code editor’s type information for signatures and the linked integration guides for examples.
| Surface | Shape | Important behaviour |
|---|---|---|
init() |
Promise of Context | Initialise once before platform calls. |
loadingProgress(fraction) |
void | Number from 0 to 1, inclusive. |
ready() |
Promise of void | Resolves after the tap-to-play gate. |
gameplayStart/Stop(), gameOver() |
void | Actual gameplay transitions; not activity counters. |
on(event, handler) |
Unsubscribe function | Host events; subscriptions can be installed before init. |
save.get/set/remove/keys |
Promises | Host-managed game data; writes can fail. |
scores.submit |
Accepted and personalBest | Submission is not always kept. |
scores.show |
Promise of void | Host overlay, resolves on close. |
share.result |
Shown and optional reason | Control shown does not mean result shared. |
player.isSignedIn/name/requestSignIn |
Promises | No persistent player id; sign-in can navigate away. |
analytics.event |
void | Declared numeric event, may be dropped. |
assets.url |
String | Local synchronous path helper; no existence check. |
assets.bytes |
Promise of ArrayBuffer | Local build asset read through SDK. |
ads.* |
Promises | Optional outcomes; production availability varies. |
Purchases, entitlements, items, paid-content loading and multiplayer rooms are not ready for complete game integrations. See feature availability before planning a game around them.
Context fields
Read sdkVersion, mode, locale, input, viewport, muted, reducedMotion, signedIn, storedSaveSchema and currentSaveSchema from init. Context is an initial snapshot, so use host events and fresh reads for changing state.
Error model
Expected negative results are distinct from exceptions. The error-code set is open; preserve a safe fallback for new codes. See Errors before writing a generic SDK wrapper.