JS SDK v.1.132.0

➕

Added

  1. createSDK: bundle only the namespaces you use (ESM). Pass the namespaces you need as the second argument, e.g. createSDK(config, [football, profile]). Only those namespaces end up in your bundle.
    1. helpers, progress and getVersion are always available.
    2. Using a namespace you didn't pass throws an error. With TypeScript, this is also reported at compile time.
    3. FansUnitedSDK still works as before and includes every namespace.
  2. Multiple statuses in the games status filter. matchQuiz.getGames and topX.getGames accept:
    1. a single status
    2. an array, e.g. {status: [GameStatusEnum.PENDING, GameStatusEnum.SETTLED]}
    3. a comma-separated string
      Values are trimmed, upper-cased and de-duplicated. Blank entries such as a trailing comma are ignored.
🚧

Changed

The status filter is now validated instead of being silently dropped. Before, an array, a comma-separated string or an unknown status was ignored without warning, and games in all statuses were returned. getGames now throws 400 / invalid_filters, and no request is sent, when:

  • a status isn't a GameStatusEnum value
  • Match Quiz / Top X get more than one status together with flags. The API doesn't support this combination.
  • standingGame.getGames, eventGame.getGames or bracketGame.getGames get more than one status.These APIs accept only one.

If you pass invalid status values today, you'll now get an error. Check your status filters before upgrading.