JS SDK v1.134.0
AddedEntry points: The ESM package is now split into entry points, so your bundler includes only the parts you import. Besides the root, you can import
createSDK, each namespace, the enums and the models directly:import { createSDK } from "fansunited-sdk-esm/createSDK"; import { football } from "fansunited-sdk-esm/namespaces/football"; import { profile } from "fansunited-sdk-esm/namespaces/profile"; import { MarketEnum } from "fansunited-sdk-esm/enums"; import { MatchFilters } from "fansunited-sdk-esm/models"; const sdk = createSDK(config, [football, profile]);
fansunited-sdk-esm/namespaces/<name>exists for every namespace thatcreateSDKaccepts:activity,bracketGame,challenges,discussions,eventGame,fantasy,football,idMapping,lists,loyalty,matchQuiz,miniGames,odds,predictor,privateLeagues,profile,sports,standingGame,topXandvoting.
fansunited-sdk-esm/enumsandfansunited-sdk-esm/modelscontain only enums and model classes, with no namespace code. Use them when you need a value such asMarketEnumwithout pulling in the whole SDK.Importing from the root still works and gives the same result in bundlers that tree-shake side-effect-free packages (webpack, Vite, Turbopack, esbuild).
FansUnitedSDKalways includes every namespace.
ChangedBundle contents: The package no longer contains CommonJS code.
node-cache, together with thecloneandeventspolyfills it brought along, is replaced by a small in-memory cache with the same behaviour, and the version is injected at build time instead of bundlingpackage.json. The only dependency left in the bundle isjwt-decode, which is ESM.Exports map:
fansunited-sdk-esm/Core/*now resolves type declarations only. These paths were never published as JavaScript, so importing a value from them failed; importing a type keeps working.
FixedSigned-out users: The SDK no longer tries to decode a JWT when there is none. Calls made while signed out, for example
sdk.profile.getOwn().getInfo(), previously loggedInvalid token specified: Cannot read properties of undefined (reading 'replace')to the console. They now fail with the usual unauthorized error, without the log line.
