github twurple/twurple v4.2.0
4.2.0

latest releases: v7.2.0, v7.1.0, v7.1.0-pre.9...
4 years ago

This version is a major step towards decoupling the chat and PubSub packages from the main API client (package twitch) by moving the responsibility to create AuthProvider instances into a new package, twitch-auth. You can gradually migrate to the new way of instantiating the client classes - the old way is deprecated, but still works (this is SemVer after all!).

Still, it also contains some minor features and fixes.

Here are all significant changes compared to version 4.1.4:

Deprecations

  • [all] default exports are discouraged, produce a warning and are scheduled for complete removal in 5.0 (b28451c, #151)
  • [all] all symbols are now strictly camel case (as opposed to some exceptions there were before, like TwitchAPICallType, now TwitchApiCallType). The respective old names have been deprecated and scheduled for removal in 5.0. (c497452, #136)
  • [twitch] TwitchClient.withCredentials, TwitchClient.withClientCredentials (construct the providers from twitch-auth directly and pass them to the ApiClient constructor instead) (fe6ace2)
  • [twitch] static methods that were moved to twitch-api-call: ApiClient.callApi -> callTwitchApi, ApiClient.getAccessToken -> exchangeCode, ApiClient.getAppAccessToken -> getAppToken, ApiClient.refreshAccessToken -> refreshUserToken, ApiClient.getTokenInfo -> getTokenInfo (fe6ace2)
  • [twitch-chat-client] ChatClient.forTwitchClient - use the ChatClient constructor with exactly the same parameters instead (fe6ace2)
  • [twitch-chat-client] passing an ApiClient instance to the ChatClient constructor; pass an AuthProvider instead (fe6ace2)
  • [twitch-chat-client] ChatClient#onPrivmsg (use onMessage instead) (9885659)

Features

  • [twitch] ApiClient can be intermittently used as an AuthProvider to support the previous usage, but you should migrate to using the AuthProvider implementations (e.g. from twitch-auth) directly (fe6ace2)
  • [twitch] add possibility to select the badge description language (fe4ed23, #143, #144)
  • [twitch] add Kraken video API methods (961b74c, #131)
  • [twitch-auth] add new package, contains all authentication helpers, the AuthProvider interface and its default implementations (fe6ace2, #140)
  • [twitch-auth] add revokeToken helper (dd5d324, #134)
  • [twitch-api-call] add new package, a thin wrapper around fetch for Twitch API calls (fe6ace2)
  • [twitch-chat-client] add onMessage handler which is like the old onPrivmsg but filters some internal messages (9885659)
  • [twitch-pubsub-client] PubSubClient#registerUserListener: return user ID for convenience (2345706)
  • [twitch-pubsub-client] add giftDuration to chat and pubsub gift sub events (6ada0a9, #159)

Fixes

  • [twitch] fix getUsersByIds and getUsersByNames falling back to token based lookup (d0145e3, #157)
  • [twitch-chat-client] fix onHosted returning NaN as count (a21a0b7)
  • [twitch-chat-client] add rudimentary check whether an emote code is a regex, and properly anchor codes (bc2a8a5, #165)
  • [twitch-pubsub-client] automatically disconnect SingleUserPubSubClient underlying client when no topics are left (3ee00c1, #166)
  • [twitch-webhooks] fix deep import of webhook option object breaking the ESM build (b08fbfa)

Don't miss a new twurple release

NewReleases is sending notifications on new releases.