2026-08-12 14:02:25 +03:00
|
|
|
# Changelog
|
|
|
|
|
|
2026-08-19 17:48:55 +03:00
|
|
|
## 0.4.0
|
|
|
|
|
|
|
|
|
|
- Fixed `BattlePassLevelSession.level` reading node data key `level` — the
|
|
|
|
|
admin editor writes `levelNumber`, so tiers always reported `0`. The session
|
|
|
|
|
now reads `levelNumber`, matching the editor and server validation.
|
|
|
|
|
- UGC support removed from the generated wire types (`src/generated/ugc.ts`
|
|
|
|
|
deleted 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.
|
|
|
|
|
|
2026-08-12 14:02:25 +03:00
|
|
|
## 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 by
|
|
|
|
|
`client.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
|
|
|
|
|
|
|
|
|
|
- `tokenStore` in `RudderClientOptions` is now optional. Default:
|
|
|
|
|
localStorage-backed store with a silent in-memory fallback where
|
|
|
|
|
localStorage is unavailable (SSR, private mode). New `createDefaultTokenStore()` export.
|
|
|
|
|
- Invalid client options (`baseUrl` / `projectKey` missing) now throw
|
|
|
|
|
`RudderError` with `code: 'sdk/invalid-options'` instead of a plain `Error`.
|
|
|
|
|
- New `onEffectError` option — 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)` and
|
|
|
|
|
`LeaderboardsService.submitScore(slug, score)`. Single path:
|
|
|
|
|
`client.leaderboards.findBySlug(slug)` → `handle.list(limit?)` / `handle.submit(score)`.
|
|
|
|
|
|
|
|
|
|
### Errors
|
|
|
|
|
|
|
|
|
|
- `RudderNetworkError.inner` → standard `Error.cause`.
|
|
|
|
|
- `RudderHttpError.code` is typed as `RudderErrorCode | (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.
|
|
|
|
|
- `SubmittedBy` is 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 matching `exports` entries.
|