@talkjs/core 1.5.9 → 1.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  The `@talkjs/core` package lets you connect to your [TalkJS](https://talkjs.com) chat as a user and read, subscribe to, and update your chat data.
4
4
 
5
- [See our docs](https://talkjs.com/docs/SDKs/JavaScript_Data_API/) for more information.
5
+ [See our docs](https://talkjs.com/docs/JavaScript_Data_API/) for more information.
6
6
 
7
7
  ## Prerequisites
8
8
 
@@ -69,6 +69,15 @@ If you encounter any problems with `@talkjs/core`, please open a [chat with supp
69
69
 
70
70
  ## Changelog
71
71
 
72
+ ### 1.6.0
73
+
74
+ - Added `TalkSession.setToken(token: string)` which reauthenticates the session with a new token.
75
+ - Added `TalkSession.onNeedToken: () => void` which gets called whenever a new auth token is needed. To use refreshable auth tokens, set a callback that fetches a new auth token and passed it to `setToken`.
76
+ - Deprecated `token` and `tokenFetcher` options in `getTalkSession` in favour of those two properties.
77
+ - Removed some duplicate logging on auth-related errors.
78
+ - Sessions no longer get garbage collected under any circumstances (to enable persistence of `.setToken`).
79
+ - Initial token fetch is now delayed until you actually use the session to send a request, rather than happening as soon as you call `getTalkSession`.
80
+
72
81
  ### 1.5.9
73
82
 
74
83
  - Fixed a bug that would make the library crash under certain conditions.