talkjs
Version:
Build the perfect messaging experience in 10 minutes.
376 lines (219 loc) • 26.7 kB
Markdown
# TalkJS JavaScript SDK
This package lets you include [TalkJS JS SDK](https://talkjs.com/docs/Reference/JavaScript_Chat_SDK/?ref=jssdk-npm-readme) snippet as an npm package.
> Please note this package is for the client-side SDK and is intended for browser environments.
We have seporate packages available if you're looking to integrate TalkJS with [React Native](https://www.npmjs.com/package/@talkjs/react-native), and a package with support for [Expo](https://www.npmjs.com/package/@talkjs/expo). [`@talkjs/react-native`](https://www.npmjs.com/package/@talkjs/react-native), [`@talkjs/@expo`](https://www.npmjs.com/package/@talkjs/expo)
## What is TalkJS?
[TalkJS](https://talkjs.com) is a developer friendly chat API with a pre-built UI that is highly customisable. You can build a chat feature in minutes instead of months.
With TalkJS, you can create chat features that boost user engagement, retention, and conversion rate.

Don't hesitate to [let us know](https://talkjs.com/?chat) if you have any questions about TalkJS.
## Getting Started
Use one of the following ways to import the library:
ES6 / TypeScript:
```js
import Talk from "talkjs";
```
CommonJS:
```js
const Talk = require("talkjs");
```
Then, follow the guide on our [documentation](https://talkjs.com/docs/?ref=jssdk-npm-readme) to start using TalkJS in your projects.
## Goals
This NPM package has two goals:
- Make it easier to inject the TalkJS snippet for developers who use front-end build chains such as Webpack or Parcel
- Provide TypeScript type definitions for the entire SDK, for an easier development experience in editors such as Atom and VS Code. Some editors (eg VS Code) will use these for autocompletion if your application is not written in TypeScript:

> Note that even if you use this package, the core TalkJS library is loaded on-the-fly from our CDN. It simply injects a small code snippet which does that asynchronously, without delaying the rest of your application.
## Examples, guides & tutorials
You can check out usage examples for this package and TalkJS in general, check out our [examples repository](https://github.com/talkjs/talkjs-examples/). Our resources section on the site covers a wide array of [tutorials](https://talkjs.com/resources/tag/tutorials/) and [Frequently asked Questions](https://talkjs.com/resources/tag/faq/).
There are multiple quickstart guides available:
- [React](https://talkjs.com/docs/Getting_Started/React/)
- [Vue](https://talkjs.com/docs/Getting_Started/Vue/)
- [Angular](https://talkjs.com/docs/Getting_Started/Angular/)
- [Svelte](https://talkjs.com/docs/Getting_Started/Svelte/)
- [Ionic](https://talkjs.com/docs/Getting_Started/Ionic/)
### Usage from Node.js
This package is currently _frontend only_. You can import this package in Node.js, but it will only work from code that is called in a browser. If you use a framework that runs the same code on Node.js and in the browser (eg Next.js), then make sure you only call TalkJS functions inside the browser. See [our Next.js example](https://github.com/talkjs/talkjs-examples/tree/master/react/next.js/) for more info.
## On forward compatibility
We take API compatibility extremely seriously. We spend a lot of effort to ensure that customer code that used to work, keeps working, even when we iterate on the SDK design. We may at times deprecate methods or fields, but we will not remove them. If something that used to work stops working, then that's a bug. Please [report it](https://talkjs.com/?chat) and we'll fix it asap.
### A note for TypeScript users
We do not consider a change in the type definitions a breaking change that warrants a major version release.
None of this should ever affect you unless you manually update the NPM package to a newer version using a command like `npm install --save talkjs@latest` at a later time. And even then, nothing will break at runtime because we provide full forward compatibility of the JavaScript API.
In other words, code like the following should always keep working and compiling, even if you update this package:
```ts
import Talk from "talkjs";
const session = new Talk.Session(..);
const inbox = session.createInbox(..);
```
But code using TypeScript types might cause compile errors when you update the package to a later version, because we may rename the `Talk.Inbox` type:
```ts
import Talk from "talkjs";
function createInbox(): Talk.Inbox { // <-- this line is the culprit
const session = new Talk.Session(..);
return session.createInbox(..);
}
```
Similarly, we may at any time remove deprecated methods, fields, classes and interfaces from the TypeScript definitions (but not from the JavaScript SDK).
## Changelog
Note: These are only the changes that have an effect on the JS level. TalkJS gets many improvements and fixes all the time. Consider subscribing to [our changelog](https://changelog.talkjs.com) if you want to stay updated.
### 0.35.0
- Added [ConversationRef.subscribe](https://talkjs.com/docs/Reference/JavaScript_Chat_SDK/Realtime_API/#ConversationRef__subscribe)
- Removed `ConversationSnapshot.lastMessageAt`. Use `ConversationSnapshot.lastMessage.createdAt` instead.
### 0.34.0
- Added [Session.uploadFile](https://talkjs.com/docs/Reference/JavaScript_Chat_SDK/Session/#Session__uploadFile) and file-subtype-specific variants. This returns a `FileToken` that you can use in `SendMessageParams` or `EditMessageParams`.
- Added [SendMessageParams](https://talkjs.com/docs/Reference/JavaScript_Chat_SDK/Realtime_API/#SendMessageParams) that can be passed to `ConversationRef.send` to send a message by specifying its content directly. This allows you to send text messages with manually-specified formatting, in addition to file attachments and locations.
- Added [EditMessageParams](https://talkjs.com/docs/Reference/JavaScript_Chat_SDK/Realtime_API/#EditMessageParams) to do the same for `MessageRef.edit`
### 0.33.0
- Added [VideoBlock](https://talkjs.com/docs/Reference/JavaScript_Chat_SDK/Realtime_API/#VideoBlock) and [AudioBlock](https://talkjs.com/docs/Reference/JavaScript_Chat_SDK/Realtime_API/#AudioBlock)
### 0.32.0
- Added [VoiceBlock](https://talkjs.com/docs/Reference/JavaScript_Chat_SDK/Realtime_API/#VoiceBlock) and [ImageBlock](https://talkjs.com/docs/Reference/JavaScript_Chat_SDK/Realtime_API/#ImageBlock) as more specific versions of FileBlock in the message content.
### 0.31.0
- Added [MessageRef](https://talkjs.com/docs/Reference/JavaScript_Chat_SDK/Realtime_API/#MessageRef) and [ConversationRef.message](https://talkjs.com/docs/Reference/JavaScript_Chat_SDK/Realtime_API/#ConversationRef__message)
- Added [MessageSnapshot.referencedMessage](https://talkjs.com/docs/Reference/JavaScript_Chat_SDK/Realtime_API/#MessageSnapshot__referencedMessage) (`MessageSnapshot.referencedMessage: ReferencedMessageSnapshot`)
- Added [ReferencedMessageSnapshot](https://talkjs.com/docs/Reference/JavaScript_Chat_SDK/Realtime_API/#ReferencedMessageSnapshot)
- Added [MessageSnapshot.content](https://talkjs.com/docs/Reference/JavaScript_Chat_SDK/Realtime_API/#MessageSnapshot__content)
- Added [ConversationRef.send](https://talkjs.com/docs/Reference/JavaScript_Chat_SDK/Realtime_API/#ConversationRef__send)
- Added [ConversationRef.subscribeMessages](https://talkjs.com/docs/Reference/JavaScript_Chat_SDK/Realtime_API/#ConversationRef__subscribeMessages), `MessageSubscription`, and `MessageActiveState`.
- Added [SendMessageParams](https://talkjs.com/docs/Reference/JavaScript_Chat_SDK/Realtime_API/#SendMessageParams) and [EditMessageParams](https://talkjs.com/docs/Reference/JavaScript_Chat_SDK/Realtime_API/#EditMessageParams)
### 0.30.0
- Added [ConversationSnapshot.lastMessage](https://talkjs.com/docs/Reference/JavaScript_Chat_SDK/Realtime_API/#ConversationSnapshot__lastMessage)
### 0.29.0
- Added [ConversationRef.markAsRead](https://talkjs.com/docs/Reference/JavaScript_Chat_SDK/Realtime_API/#ConversationRef__markAsRead) and [ConversationRef.markAsUnread](https://talkjs.com/docs/Reference/JavaScript_Chat_SDK/Realtime_API/#ConversationRef__markAsUnread)
### 0.28.0
- Added [ParticipantRef](https://talkjs.com/docs/Reference/JavaScript_Chat_SDK/Realtime_API/#ParticipantRef) to the Realtime API.
- Added [ConversationRef.participant](https://talkjs.com/docs/Reference/JavaScript_Chat_SDK/Realtime_API/#ConversationRef__participant) to get a participant ref.
- Added [ConversationSnapshot.joinedAt](https://talkjs.com/docs/Reference/JavaScript_Chat_SDK/Realtime_API/#ConversationSnapshot__joinedAt).
### 0.27.0
- Added [ConversationRef.set](https://talkjs.com/docs/Reference/JavaScript_Chat_SDK/Realtime_API/#ConversationRef__set) and [ConversationRef.createIfNotExists](https://talkjs.com/docs/Reference/JavaScript_Chat_SDK/Realtime_API/#ConversationRef__set) to the Realtime API.
### 0.26.0
- Added [customEmojis](https://talkjs.com/docs/Reference/JavaScript_Chat_SDK/Session/#ChatboxOptions__customEmojis) setting to `createChatbox`, `createInbox` and `createPopup`.
### 0.25.0
- Removed UserData. Everything that previously returned UserData now returns [UserSnapshot](https://talkjs.com/docs/Reference/JavaScript_Chat_SDK/Realtime_API/#UserSnapshot).
- [UserSnapshot.locale](https://talkjs.com/docs/Reference/JavaScript_Chat_SDK/Realtime_API/#UserSnapshot__locale) and [SetUserParams.role](https://talkjs.com/docs/Reference/JavaScript_Chat_SDK/Realtime_API/#SetUserParams__role) are now correctly marked as nullable
### 0.24.0
- Added support for subscribing to a user, via [UserRef.subscribe](https://talkjs.com/docs/Reference/JavaScript_Chat_SDK/Realtime_API/#UserRef__subscribe) which returns a [UserSubscription](https://talkjs.com/docs/Reference/JavaScript_Chat_SDK/Realtime_API/#UserSubscription)
### 0.23.1
- Fixed `ConversationSnapshot.createdAt` and `ConversationSnapshot.lastMessageAt` to be `number` instead of `Date`.
### 0.23.0
- Added [ConversationRef](https://talkjs.com/docs/Reference/JavaScript_Chat_SDK/Realtime_API/#ConversationRef) to fetch and manipulate data about conversations. Currently the only method available is `get(): ConversationSnapshot`.
- Added [Session.conversation(id: string): ConversationRef](https://talkjs.com/docs/Reference/JavaScript_Chat_SDK/Session/#Session__conversation) to get a reference to a conversation by id.
### 0.22.0
- Added [UserRef.set](https://talkjs.com/docs/Reference/JavaScript_Chat_SDK/Realtime_API/#UserRef__set) and [UserRef.createIfNotExists](https://talkjs.com/docs/Reference/JavaScript_Chat_SDK/Realtime_API/#UserRef__createIfNotExists) to the Realtime API.
### 0.21.0
- Added support for JWT-based session authentication, adding [SessionOptions.token](https://talkjs.com/docs/Reference/JavaScript_Chat_SDK/Session/#SessionOptions__token) and [SessionOptions.tokenFetcher](https://talkjs.com/docs/Reference/JavaScript_Chat_SDK/Session/#SessionOptions__tokenFetcher). See the [authentication documentation](https://talkjs.com/docs/Features/Security_Settings/Authentication/) and [advanced authentication documentation](https://talkjs.com/docs/Features/Security_Settings/Advanced_Authentication/) for more information about JWT authentication.
- Deprecated [SessionOptions.signature](https://talkjs.com/docs/Reference/JavaScript_Chat_SDK/Session/#SessionOptions__signature). It will continue to be supported indefinitely, but JWT authentication is recommended for new projects.
### 0.20.0
- Added first aspects of the Realtime API
- Added [UserRef](https://talkjs.com/docs/Reference/JavaScript_Chat_SDK/Realtime_API/#UserRef) to fetch and manipulate data about users
- Added [Session.currentUser: UserRef](https://talkjs.com/docs/Reference/JavaScript_Chat_SDK/Session/#Session__currentUser) to get a reference to the current user for use in the Realtime API
- Added [Session.user(id: string): UserRef](https://talkjs.com/docs/Reference/JavaScript_Chat_SDK/Session/#Session__user) to get a reference to an arbitrary user
### 0.19.0
- Added option `messageId` to [Inbox.select](https://talkjs.com/docs/Reference/JavaScript_Chat_SDK/Inbox/#Inbox__select)
### 0.18.0
- Deprecated `ConversationSelectedEvent.others` and `SelectConversationEvent.others` in favour of `.participants` due to `others` having strange behaviour when in a conversation by yourself.
- Calling `.select` on a UI now returns a promise that is resolved when the new conversation is selected
### 0.17.0
- Added the ability to use [action buttons and links](https://talkjs.com/docs/Features/Customizations/Action_Buttons_Links/) inside the `ConversationListHeader` and `ConversationListItem` theme components. As a result, [`ConversationActionEvent.conversation`](https://talkjs.com/docs/Reference/JavaScript_Chat_SDK/Other_interfaces/#ConversationActionEvent__conversation) can now be `null`.
### 0.16.6
- The [InboxOptions.selected](https://talkjs.com/docs/Reference/JavaScript_Chat_SDK/Session/#InboxOptions__selected) property has been deprecated in favour of [Inbox.select](https://talkjs.com/docs/Reference/JavaScript_Chat_SDK/Inbox/#Inbox__select).
### 0.16.5
- Added property [ConversationData.participants](https://talkjs.com/docs/Reference/JavaScript_Chat_SDK/Session/#ConversationData__participants)
### 0.16.4
- Added property [Session.unreads.unreadMessageCount](https://talkjs.com/docs/Reference/JavaScript_Chat_SDK/Session/#UnreadConversation__unreadMessageCount).
### 0.16.3
- Added properties [Session.isAlive](https://talkjs.com/docs/Reference/JavaScript_Chat_SDK/Session/#Session__isAlive), [Chatbox.isAlive](https://talkjs.com/docs/Reference/JavaScript_Chat_SDK/Chatbox/#Chatbox__isAlive), [Inbox.isAlive](https://talkjs.com/docs/Reference/JavaScript_Chat_SDK/Inbox/#Inbox__isAlive) and [Popup.isAlive](https://talkjs.com/docs/Reference/JavaScript_Chat_SDK/Popup/#Popup__isAlive) to check whether the session or widget has been [destroy](https://talkjs.com/docs/Reference/JavaScript_Chat_SDK/Session/#Session__destroy)ed or not.
- Made the `action` parameter in [onCustomConversationAction](https://talkjs.com/docs/Reference/JavaScript_Chat_SDK/Chatbox/#Chatbox__onCustomConversationAction) and [onCustomMessageAction](https://talkjs.com/docs/Reference/JavaScript_Chat_SDK/Chatbox/#Chatbox__onCustomConversationAction) optional, so that it can trigger an event for any action.
### 0.16.2
- Added [session.onBrowserPermissionNeeded](http://talkjs.com/docs/Reference/JavaScript_Chat_SDK/Session/#Session__onBrowserPermissionNeeded). This event is triggered when the browser is about to prompt the user for a certain permission. You can use this to show more information to the user before the browser prompt.
- Added [session.onBrowserPermissionDenied](http://talkjs.com/docs/Reference/JavaScript_Chat_SDK/Session/#Session__onBrowserPermissionDenied). This event is triggered when the user or the browser denies a certain permission. You can use this to show an explanation of how to re-enable the permission if they change their mind.
### 0.16.1
- The `theme` option passed to [`session.createChatbox`](https://talkjs.com/docs/Reference/JavaScript_Chat_SDK/Session/#Session__createChatbox) and other methods to create a widget now optionally lets you pass a `custom` property to pass data to theme. [Read our documentation on passing data to themes](https://feat-theme-widget-variables.talkjsonprem.com/docs/Features/Themes/Passing_Data_to_Themes/) for more info.
### 0.16.0
- Add [ConversationActionEvent](https://talkjs.com/docs/Reference/JavaScript_Chat_SDK/Other_interfaces/#ConversationActionEvent) interface.
- Add [LeaveConversationEvent](https://talkjs.com/docs/Reference/JavaScript_Chat_SDK/Other_interfaces/#LeaveConversationEvent) interface.
- Add [NumberPredicate](https://talkjs.com/docs/Reference/JavaScript_Chat_SDK/Other_interfaces/#NumberPredicate).
- Update [onDesktopNotificationClicked](https://talkjs.com/docs/Reference/JavaScript_Chat_SDK/Session/#Session__onDesktopNotificationClicked) method.
### 0.15.9
- Add [onCustomConversationAction](https://talkjs.com/docs/Reference/JavaScript_Chat_SDK/Chatbox/#Chatbox__onCustomConversationAction) method.
### 0.15.8
- Updated README.md (Forgot to add the changelog entry for 0.15.7)
### 0.15.7
- Add `lastMessageTs` and `subject` to [ConversationPredicate](https://talkjs.com/docs/Reference/JavaScript_Chat_SDK/Other_interfaces/#ConversationPredicate).
### 0.15.6
- Add [UserPresence](https://talkjs.com/docs/Reference/JavaScript_Chat_SDK/Inbox/#UserPresence) interface.
- Add `presence` to [ChatboxOptions](https://talkjs.com/docs/Reference/JavaScript_Chat_SDK/Session/#ChatboxOptions__presence), [InboxOptions](https://talkjs.com/docs/Reference/JavaScript_Chat_SDK/Session/#ChatboxOptions__presence) and [PopupOptions](https://talkjs.com/docs/Reference/JavaScript_Chat_SDK/Session/#PopupOptions__presence).
### 0.15.5
- Add `sendFile` and `sendLocation` methods to [Chatbox](https://talkjs.com/docs/Reference/JavaScript_Chat_SDK/Chatbox/#Chatbox__sendFile), [Inbox](https://talkjs.com/docs/Reference/JavaScript_Chat_SDK/Inbox/#Inbox__sendFile) and [Popup](https://talkjs.com/docs/Reference/JavaScript_Chat_SDK/Popup/#Popup__sendFile)
- Add `MentionsOnly` [Notify](https://talkjs.com/docs/Reference/Concepts/Participants/#notify) option to [setParticipant](https://talkjs.com/docs/Reference/Concepts/Participants/#notify).
### 0.15.4
- Add [onKeydown](https://talkjs.com/docs/Reference/JavaScript_Chat_SDK/Chatbox/#Chatbox__onKeydown) event to [Chatbox](https://talkjs.com/docs/Reference/JavaScript_Chat_SDK/Chatbox/#Chatbox__onKeydown), [Inbox](https://talkjs.com/docs/Reference/JavaScript_Chat_SDK/Inbox/#Inbox__onKeydown) and [Popup](https://talkjs.com/docs/Reference/JavaScript_Chat_SDK/Popup/#Popup__onKeydown).
- Rename `KeyupEvent` to [KeyEvent](https://talkjs.com/docs/Reference/JavaScript_Chat_SDK/Other_interfaces/#KeyEvent) (the old `KeyupEvent` remains exported as an alias)
### 0.15.3
- [session.registerDevice](https://talkjs.com/docs/Reference/JavaScript_Chat_SDK/Session/#Session__registerDevice) and [session.unregisterDevice](https://talkjs.com/docs/Reference/JavaScript_Chat_SDK/Session/#Session__unregisterDevice) have been deprecated in favour of the new [session.setPushRegistration](https://talkjs.com/docs/Reference/JavaScript_Chat_SDK/Session/#Session__setPushRegistration), [session.unsetPushRegistration](https://talkjs.com/docs/Reference/JavaScript_Chat_SDK/Session/#Session__unsetPushRegistration) and [session.clearPushRegistrations](https://talkjs.com/docs/Reference/JavaScript_Chat_SDK/Session/#Session__clearPushRegistrations). These newer methods give you more fine-grained control over multiple push registrations for the same user. The old methods will continue to work, but for new projects, we recommend changing to the newer methods.
### 0.15.2
- The way to attach event handlers has changed. Methods like `on("focus", handler)` to register events on the [Chatbox](https://talkjs.com/docs/Reference/JavaScript_Chat_SDK/Chatbox/#Chatbox__on), [Popup](https://talkjs.com/docs/Reference/JavaScript_Chat_SDK/Popup/#Popup__on) or [Inbox](https://talkjs.com/docs/Reference/JavaScript_Chat_SDK/Inbox/#Inbox__on) are now deprecated. Instead, we recommend that you use the equivalent methods like [`onFocus`](https://talkjs.com/docs/Reference/JavaScript_Chat_SDK/Chatbox/#Chatbox__onFocus) instead. The same thing goes for event handlers on [Session](https://talkjs.com/docs/Reference/JavaScript_Chat_SDK/Session) and [Unreads](https://talkjs.com/docs/Reference/JavaScript_Chat_SDK/Session#Unreads) objects.
- Similarly the `off` method to remove event listeners has been deprecated too. New event handler methods return a [Subscription](https://talkjs.com/docs/Reference/JavaScript_Chat_SDK/Other_interfaces/#Subscription) object, which has an `unsubscribe()` method to stop listening for events.
- Add [onCustomMessageAction](https://talkjs.com/docs/Reference/JavaScript_Chat_SDK/Chatbox/#Chatbox__onCustomMessageAction) event
### 0.15.1
- Add [captureKeyboardEvents](https://talkjs.com/docs/Reference/JavaScript_Chat_SDK/Session/#ChatboxOptions__captureKeyboardEvents) option
- Add [on("keyup")](https://talkjs.com/docs/Reference/JavaScript_Chat_SDK/Chatbox/#Chatbox__on__keyup__) event
- Add [MessageField.getText](https://talkjs.com/docs/Reference/JavaScript_Chat_SDK/Other_interfaces/#MessageField__typeText) and [MessageField.typeText](https://talkjs.com/docs/Reference/JavaScript_Chat_SDK/Other_interfaces/#MessageField__typeText) methods.
### 0.15.0
- Add [Guest access](https://talkjs.com/docs/Reference/Concepts/Guests/) that enables hundreds of users in the chat at the same time.
### 0.14.5
- Add a [messageField.autofocus](https://talkjs.com/docs/Reference/JavaScript_Chat_SDK/Other_interfaces.html#MessageFieldOptions.autofocus) which lets you disable automatically focusing the message field.
### 0.14.4
- Added [`theme`](https://talkjs.com/docs/Reference/JavaScript_Chat_SDK/Session.html#ChatboxOptions.theme) option to [createInbox, createChatbox and createPopup](https://talkjs.com/docs/Reference/JavaScript_Chat_SDK/Session.html#Session.createChatbox) which lets you override which [Custom Theme](https://talkjs.com/resources/announcing-themesv2/) is shown.
- Added [`session.on("desktopNotificationClicked")`](https://talkjs.com/docs/Reference/JavaScript_Chat_SDK/Session.html#Session.on__desktopNotificationClicked__) which lets you handle user clicks on browser notifications.
### 0.14.3
- Added the [inbox.on("selectConversation")](https://talkjs.com/docs/Reference/JavaScript_Chat_SDK/Inbox.html#Inbox.on__selectConversation__) event, which triggers _before_ a user switches to a different conversation.
- Enabled passing `undefined` and `null` as paremeters to [inbox.select, chatbox.select, popup.select](https://talkjs.com/docs/Reference/JavaScript_Chat_SDK/Inbox.html#Inbox.select) and to [session.createInbox, session.createChatbox, session.createPopup](https://talkjs.com/docs/Reference/JavaScript_Chat_SDK/Session.html#Session.createInbox).
### 0.14.2
- Fixed [getPopups, getInboxes and getChatboxes](https://talkjs.com/docs/Reference/JavaScript_Chat_SDK/Session.html#Session.getInboxes) types.
### 0.14.1
- Added methods to get UIs, namely [getPopups, getInboxes and getChatboxes](https://talkjs.com/docs/Reference/JavaScript_Chat_SDK/Session.html#Session.getInboxes).
### 0.14.0
- Added the ability to search within a conversation - available on the Premium plan and above.
- Changed the default for the popup's 'launcher' option to default to 'always' instead of 'close-only'.
- Changed the default for the popup's 'keepOpen' option to default to 'false' instead of 'true'.
### 0.13.1
- Add option to show/hide the mobile back button for the Inbox UI.
### 0.13.0
- Add support for [real-time message translation](https://talkjs.com/docs/Features/Language_Support/Real-Time_Message_Translation/#obtain-and-configure-a-google-api-key).
### 0.12.0
- Simplify "no chats" inbox layout; take background and borders from theme `.panel` setting.
### 0.11.0
- Add [MessageField.setVisible](https://talkjs.com/docs/Reference/JavaScript_Chat_SDK/Other_interfaces.html#MessageField.setVisible) method and a [messageField.visible](https://talkjs.com/docs/Reference/JavaScript_Chat_SDK/Session.html#InboxOptions.messageField) setting to [`createInbox`](https://talkjs.com/docs/Reference/JavaScript_Chat_SDK/Session.html#Session.createInbox) and friends.
### 0.10.3
- Add [Message Field settings](https://talkjs.com/docs/Reference/JavaScript_Chat_SDK/Session.html#InboxOptions.messageField) to [`createInbox`](https://talkjs.com/docs/Reference/JavaScript_Chat_SDK/Session.html#Session.createInbox) and friends.
### 0.10.2
- Make the SDK compatible with typescript 2.3 and older browsers.
### 0.10.1
- Fix circular type reference.
### 0.10.0
- Fix bug that would not let TypeScript users do `import Talk from "talkjs"` in some situations. Note that before this change, in _some_ setups you could actually do `import * as Talk` to get around this. That stops working now.
### 0.9.1
- Added [`Session#destroy`](https://talkjs.com/docs/Reference/JavaScript_Chat_SDK/Session.html#Session.destroy) that destroys the current connection to the TalkJS server.
### 0.9.0
- Removed exception when `talkjs` is required or imported in non-browser environments (eg Node.js). _Using_ the package outside the browser still throws an exception, but just importing it doesn't anymore.
### 0.8.1
- Exposed `Talk.Error`.
- Added [`MessageFilter`](https://talkjs.com/docs/Reference/JavaScript_Chat_SDK/Session.html#InboxOptions.messageFilter).
- Added missing `custom` field to the `Message` interface.
- Added the ability to override message contents and custom field via the JSSDK.
### 0.8.0
- Added explicit support for ESNext modules, to make this package work with eg Rollup.
- Typings now expose the `custom` field on the `Message` interface
- Fixed TypeScript exports: types were exported as separate named exports, even though the TalkJS SDK actually default-exports a single Talk object. To update existing an TypeScript codebase to use the new types, change all occurrences of `import * as Talk from "talkjs"` to `import Talk from "talkjs"`. If you use CommonJS (`require`) then no changes are needed.
### 0.7.0
- Add [conversation welcome messages](https://talkjs.com/docs/Reference/JavaScript_Chat_SDK/ConversationBuilder.html#ConversationBuilder.welcomeMessages), which are rendered similar to system messages
- Add [`chatBox.messageField.setText(...)`](https://talkjs.com/docs/Reference/JavaScript_Chat_SDK/Other_interfaces.html#MessageField.setText)
- Rename `User.configuration` to [`User.role`](https://talkjs.com/docs/Reference/JavaScript_Chat_SDK/User.html#User.role) (with full backward compatibility, i.e. `configuration` is now a deprecated alias for `role`.
### 0.6.1
- Add support for [Inbox feed filters](https://talkjs.com/docs/Reference/JavaScript_Chat_SDK/Session.html#InboxOptions.feedFilter).
### 0.6.0
- Converted some classes to interfaces (eg `Inbox` is now an interface).
- Exported all interfaces that the SDK exposes. For example, `Session.getOrCreateConversation` returns a `ConversationBuilder` interface, which you can now use in TypeScript code like `function updateConversation(conversation: Talk.ConversationBuilder) {..}`.
### 0.5.0
- Exported core interfaces in the TypeScript type definitions: Chatbox, Conversation, ConversationBuilder, Inbox, Popup.
- Began tracking a changelog :-)