1491b5e357
- engine/ (DagWalker, sessions, IndexedDbPlanStore) deleted; server owns the graph - trigger/callback/counter carry PendingEffect; GET /sdk/v1/scenarios/pending polled (30s jittered heartbeat paused on hidden tab + wait-deadline timers) - client.effects public API unchanged (done/buy/dismiss/end/claim/battlepass/quest) - planStateStore removed; loginEvent kept; reconcile() makes server the source of truth - generated models regenerated; skills/README/CHANGELOG updated
5.1 KiB
5.1 KiB
Changelog
Unreleased
- Scenario execution moved server-side. The SDK no longer walks a local DAG or persists plan state to IndexedDB.
- Removed
RudderClientOptions.runtime.planStateStoreand thePlanStateStoretype. GET /sdk/v1/scenarios/pendingis polled on login, on a ~30s heartbeat, and at each effectwaitDeadline. Completions POST/sdk/v1/scenarios/callback; the response may carry the nextPendingEffect.- Scenario
remote_config_overridenodes no longer emitonConfigChanged(the server applies the override). TheConfigChangedEffecttype andonConfigChangedsubscription remain.
0.6.0
LeaderboardSession.claim()/ effectclaim()completes the leaderboard node with handleonClaim. The server matches live rank to an authored place and continues from that place (Grant Reward and/or In-App Message).rewardClaimed()is a deprecated alias forclaim()and will be removed in the next SDK version.rank_not_eligibleon Claim leaves the session open (retry Claim or End); it no longer fails the run.
0.5.1
QuestMetrics/reportProgress: custom free-text metrics no longer progress quests. Report a released catalog counter slug instead.purchaseOffer/purchaseItemhelpers are unchanged (server-side shop fan-out).
0.5.0
client.auth.loginWithCustom({ customData, region?, language?, nickname? })— custom webhook auth, same token + runtime start asloginWithDevice.QuestMetrics.purchaseOffer/purchaseItemhelpers for the shop purchase metric format.- Typecheck against regenerated models:
listQuestsno longer takes a body, battle-passtrackis'free' | 'premium', scenario run status has nounknown_run.
0.4.0
- Fixed
BattlePassLevelSession.levelreading node data keylevel— the admin editor writeslevelNumber, so tiers always reported0. The session now readslevelNumber, matching the editor and server validation. - UGC support removed from the generated wire types (
src/generated/ugc.tsdeleted by apigen); no UGC surface was ever exposed by this SDK. - Generated API types regenerated from the gateway openapi spec, adding the new platform operations.
0.3.0
Breaking changes — the package was aligned with the Rudder SDK glossary and
the regenerated wire types (src/generated, apigen). No compatibility shims
are provided.
Auth
client.auth.loginViaDevice(region, language, nickname?)replaced byclient.auth.loginWithDevice(options?: { region?, language?, nickname? }). Default region is now'global'(was'en'); default language stays'en'.- New
client.auth.onAuthStateChange(cb)— fires immediately with the current state, then on every'signed-in' | 'signed-out'transition (login, logout, and unrecoverable session expiry in the transport). - New
client.auth.isAuthenticated.
Client configuration
tokenStoreinRudderClientOptionsis now optional. Default: localStorage-backed store with a silent in-memory fallback where localStorage is unavailable (SSR, private mode). NewcreateDefaultTokenStore()export.- Invalid client options (
baseUrl/projectKeymissing) now throwRudderErrorwithcode: 'sdk/invalid-options'instead of a plainError. - New
onEffectErroroption — called when an effect handler throws (default:console.error); previously such errors were swallowed silently.
Renames
client.config→client.remoteConfig(canonical glossary name).client.battlepass→client.battlePass;BattlepassService→BattlePassService.- Effects:
onBattlepass/BattlepassEffect→onBattlePass/BattlePassEffect;onBattlepassLevel/BattlepassLevelEffect→onBattlePassLevel/BattlePassLevelEffect. - Generated types:
SdkQuest→Quest;*Battlepass*request/response types →*BattlePass*. - Internal transport
sendAsync→request(not part of the public surface).
Leaderboards
- Removed
LeaderboardsService.getRanking(slug, limit)andLeaderboardsService.submitScore(slug, score). Single path:client.leaderboards.findBySlug(slug)→handle.list(limit?)/handle.submit(score).
Errors
RudderNetworkError.inner→ standardError.cause.RudderHttpError.codeis typed asRudderErrorCode | (string & {})(generated union of server error codes, plus room for unknown strings).- New exports:
RudderErrorCode(type),RudderErrorCodes(constants),SDK_ERROR_INVALID_OPTIONS,RudderErrorCodeLike(type).
Public surface
- The barrel no longer exports
getOrCreateDeviceId, domain classes (PlayerDomain, …) or service constructors (AuthService, …) as values — they remain available as types. Instances live on the client. SubmittedByis no longer re-exported (UGC is unsupported on web).
Bundle
- The scenario engine and the IndexedDB plan store are loaded lazily (dynamic import) on first login / first runtime access — a thin client never pulls the scenario machinery into the initial chunk.
- The package now ships both ESM (
dist/index.js) and CJS (dist/index.cjs) builds with matchingexportsentries.