# Changelog: Twilio Chat JavaScript SDK

> \[!CAUTION]
>
> Programmable Chat has been deprecated and is no longer supported. Instead, we'll be focusing on the next generation of chat: Twilio Conversations. Find out more about the [EOL process here](https://www.twilio.com/en-us/changelog/programmable-chat-end-of-life-notice).
>
> If you're starting a new project, please visit the [Conversations Docs](/docs/conversations) to begin. If you've already built on Programmable Chat, please visit our [Migration Guide](/docs/conversations/migrating-chat-conversations) to learn about how to switch.

## Latest release: Chat SDK 6.0.0

We recommend using the following references in your projects. As we make patch releases, these links will automatically include those fixes with full backwards compatibility.

* [js](https://media.twiliocdn.com/sdk/js/chat/releases/5.0.2/twilio-chat.js) — Non-minified Chat SDK bundled for browsers, hosted on Twilio CDN.
* [min](https://media.twiliocdn.com/sdk/js/chat/releases/5.0.2/twilio-chat.min.js) — Minified Chat SDK bundled for browsers, hosted on Twilio CDN.
* [Documentation](https://media.twiliocdn.com/sdk/js/chat/releases/5.0.2/docs/) — Hosted on Twilio CDN.
* [npm](https://www.npmjs.com/package/twilio-chat)

  ```bash
  npm install --save twilio-chat
  ```

## Support for previous versions of the Chat SDKs

Twilio Programmable Chat SDKs use [Semantic Versioning](https://www.semver.org/). Twilio supports version N-1 for 12 months after the first GA release of version N. We recommend that you upgrade to the latest version as soon as possible to avoid any breaking changes. Version 5.x is the latest generation of the Javascript client SDK.

**Support for 4.x will cease on May 17, 2022**. Please upgrade to the latest version.

**Support for 3.x ceased on July 17, 2021**.

**End-of-Life for 2.x occurred on May 18, 2020**.

**End-of-Life for 1.x occurred on June 30, 2019.**

## Changelog

Links are provided to specific patch versions here. We don't recommend using these links unless you have a specific need for a certain patch of a release.

### Programmable Chat 6.0.0 *(November 25, 2021)*

* [js](https://media.twiliocdn.com/sdk/js/chat/releases/6.0.0/twilio-chat.js)
* [min](https://media.twiliocdn.com/sdk/js/chat/releases/6.0.0/twilio-chat.min.js)
* [docs](https://media.twiliocdn.com/sdk/js/chat/releases/6.0.0/docs/)

#### Changes

* Bump Node required version to current LTS (14).
* Default exports are removed in favor of named exports.
* Should now work with React Native and Angular.
* Added `.onWithReplay()` function to Conversation entities which could be used to subscribe to an event with replay. Upon subscribing, the most recent event (if any) will be re-emitted.

***

### Programmable Chat 5.0.2 *(July 16, 2021)*

* [js](https://media.twiliocdn.com/sdk/js/chat/releases/5.0.2/twilio-chat.js)
* [min](https://media.twiliocdn.com/sdk/js/chat/releases/5.0.2/twilio-chat.min.js)
* [docs](https://media.twiliocdn.com/sdk/js/chat/releases/5.0.2/docs/)

#### Fixes

* Fix compilation of TS with type exports, broken since 5.0.1.

***

### Programmable Chat 5.0.1 *(June 30, 2021)*

* [js](https://media.twiliocdn.com/sdk/js/chat/releases/5.0.1/twilio-chat.js)
* [min](https://media.twiliocdn.com/sdk/js/chat/releases/5.0.1/twilio-chat.min.js)
* [docs](https://media.twiliocdn.com/sdk/js/chat/releases/5.0.1/docs/)

#### Fixes \[#fixes-2]

* Fixed polyfills for IE11.
* As part of the above fix, the package build process was also upgraded from `gulp` to `rollup`. Unfortunately, this caused change in the type exports. While not affecting the deployments in the wild, it made TS compilation impossible. The fix for it is deployed in 5.0.2 so please **do not use** this version explicitly.

***

### Programmable Chat 5.0.0 *(May 17, 2021)*

* [js](https://media.twiliocdn.com/sdk/js/chat/releases/5.0.0/twilio-chat.js)
* [min](https://media.twiliocdn.com/sdk/js/chat/releases/5.0.0/twilio-chat.min.js)
* [docs](https://media.twiliocdn.com/sdk/js/chat/releases/5.0.0/docs/)

#### Breaking changes

* **Major internals improvement (the "Sessionless" protocol).** This improvement is designed primarily for improved reliability. While this is not a breaking code change, it does carry a meaningful impact on timing:
  * SDK commands will return success or failure up to \~10% more quickly than before.
  * **Real-time updates of data is now likely to arrive after the command completes.** For example, `Channel.updateAttributes()` will resolve successfully while `Channel#attributes` still contains the old value. To see the new value, we recommend waiting for an `#updated` event.
* Passing `null` to `Channel.sendMessage` will result with the message body being an empty string.
* `User.updateFriendlyName` no longer accepts null as the value.
* `Channel.updateFriendlyName` no longer accepts null as the value.

***

### Programmable Chat 4.1.0 *(December 16, 2020)*

* [js](https://media.twiliocdn.com/sdk/js/chat/releases/4.1.0/twilio-chat.js)
* [min](https://media.twiliocdn.com/sdk/js/chat/releases/4.1.0/twilio-chat.min.js)
* [docs](https://media.twiliocdn.com/sdk/js/chat/releases/4.1.0/docs/)

#### Changes \[#changes-2]

* Bugfixes.
* Dependency bumps.
* Various documentation improvements.

***

### Programmable Chat 4.0.0 *(July 17, 2020)*

* [js](https://media.twiliocdn.com/sdk/js/chat/releases/4.0.0/twilio-chat.js)
* [min](https://media.twiliocdn.com/sdk/js/chat/releases/4.0.0/twilio-chat.min.js)
* [docs](https://media.twiliocdn.com/sdk/js/chat/releases/4.0.0/docs/)

#### Changes \[#changes-3]

* `Message.timestamp` renamed to `Message.dateCreated`.
* `Channel.lastMessage.timestamp` also renamed to `Channel.lastMessage.dateCreated`.
* Update reason `timestamp` for `Message` objects got also renamed to `dateCreated`.
* Channel status `"known"` renamed to `"notParticipating"`.
* `Media.getContentUrl` renamed to `Media.getContentTemporaryUrl`.
* Various `attributes` arguments now accept all valid JSON values (numbers, strings, objects, arrays, Booleans, nulls).

***

### Programmable Chat 3.4.0 *(May 28, 2020)*

* [js](https://media.twiliocdn.com/sdk/js/chat/releases/3.4.0/twilio-chat.js)
* [min](https://media.twiliocdn.com/sdk/js/chat/releases/3.4.0/twilio-chat.min.js)
* [docs](https://media.twiliocdn.com/sdk/js/chat/releases/3.4.0/docs/)

#### Changes \[#changes-4]

* Added read-only `state` property to the Channel class which reflects the Conversations state.

***

### Programmable Chat 3.3.7 *(April 30, 2020)*

* [js](https://media.twiliocdn.com/sdk/js/chat/releases/3.3.7/twilio-chat.js)
* [min](https://media.twiliocdn.com/sdk/js/chat/releases/3.3.7/twilio-chat.min.js)
* [docs](https://media.twiliocdn.com/sdk/js/chat/releases/3.3.7/docs/)

#### Changes \[#changes-5]

* Connection errors are now reported with more details about what actually happened.

***

### Programmable Chat 3.3.5 *(April 16, 2020)*

* [js](https://media.twiliocdn.com/sdk/js/chat/releases/3.3.5/twilio-chat.js)
* [min](https://media.twiliocdn.com/sdk/js/chat/releases/3.3.5/twilio-chat.min.js)
* [docs](https://media.twiliocdn.com/sdk/js/chat/releases/3.3.5/docs/)

#### Bug Fixes

* Typing timeout indicator now gets correctly set to reflect the setting for the instance on the console
* Logger name is now set to "twilio-chat"

***

### Programmable Chat 3.3.4 *(January 6, 2020)*

* [js](https://media.twiliocdn.com/sdk/js/chat/releases/3.3.4/twilio-chat.js)
* [min](https://media.twiliocdn.com/sdk/js/chat/releases/3.3.4/twilio-chat.min.js)
* [docs](https://media.twiliocdn.com/sdk/js/chat/releases/3.3.4/docs/)

#### Bug Fixes \[#bug-fixes-2]

* Extended media message sending documentation
* Fixed media messages send from node.js

***

### Programmable Chat 3.3.3 *(November 27, 2019)*

* [js](https://media.twiliocdn.com/sdk/js/chat/releases/3.3.3/twilio-chat.js)
* [min](https://media.twiliocdn.com/sdk/js/chat/releases/3.3.3/twilio-chat.min.js)
* [docs](https://media.twiliocdn.com/sdk/js/chat/releases/3.3.3/docs/)

#### Bug Fixes \[#bug-fixes-3]

* Extended documentation.
* Updated to latest twilio-sync with fixes in objects caching

***

### Programmable Chat 3.3.2 *(September 18, 2019)*

* [js](https://media.twiliocdn.com/sdk/js/chat/releases/3.3.2/twilio-chat.js)
* [min](https://media.twiliocdn.com/sdk/js/chat/releases/3.3.2/twilio-chat.min.js)
* [docs](https://media.twiliocdn.com/sdk/js/chat/releases/3.3.2/docs/)

#### Bug Fixes \[#bug-fixes-4]

* Fixed `Client.setPushRegistrationId` / `Client.unsetPushRegistrationId` to resolve only after successful operation.
* Fixed emitting `Client#channelRemoved` event correctly for private channels.
* Improved documentation: added `Channel#removed` event.
* Removed `isomorphic-form-data` from dependencies.
* Fixed issues appearing in restrictive browser environments, enabling SDK operation without session storage.

***

### Programmable Chat 3.3.1 *(July 24, 2019)*

* [js](https://media.twiliocdn.com/sdk/js/chat/releases/3.3.1/twilio-chat.js)
* [min](https://media.twiliocdn.com/sdk/js/chat/releases/3.3.1/twilio-chat.min.js)
* [docs](https://media.twiliocdn.com/sdk/js/chat/releases/3.3.1/docs/)

#### Bug Fixes \[#bug-fixes-5]

* Updated twilio-sync.js dependency with security fixes
* Fixed a bug when removing a Member from Channel

***

### Programmable Chat 3.3.0 *(June 27, 2019)*

* [js](https://media.twiliocdn.com/sdk/js/chat/releases/3.3.0/twilio-chat.js)
* [min](https://media.twiliocdn.com/sdk/js/chat/releases/3.3.0/twilio-chat.min.js)
* [docs](https://media.twiliocdn.com/sdk/js/chat/releases/3.3.0/docs/)

#### Changes \[#changes-6]

* Added `Channel.getMemberBySid` method to get Member by provided Sid
* Added `Channel.getMemberByIdentity` method to get Member by provided Identity
* Property `Channel.createdBy` can be null
* Added `Message.member_sid` property
* Property `Message.author` can be null
* Added `Message.getMember` method to get authoring Member of Message by `member_sid` (if available) and if not found then by `author` (identity)

***

### Programmable Chat 3.2.4 *(June 25, 2019)*

* [js](https://media.twiliocdn.com/sdk/js/chat/releases/3.2.4/twilio-chat.js)
* [min](https://media.twiliocdn.com/sdk/js/chat/releases/3.2.4/twilio-chat.min.js)
* [docs](https://media.twiliocdn.com/sdk/js/chat/releases/3.2.4/docs/)

#### Changes \[#changes-7]

* Introduced `Client#event:connectionError` event.
* Fixed a bug, where recovery after a partial network degradations the websocket did not reconnect.

***

### Programmable Chat 3.2.3 *(April 15, 2019)*

* [js](https://media.twiliocdn.com/sdk/js/chat/releases/3.2.3/twilio-chat.js)
* [min](https://media.twiliocdn.com/sdk/js/chat/releases/3.2.3/twilio-chat.min.js)
* [docs](https://media.twiliocdn.com/sdk/js/chat/releases/3.2.3/docs/)

#### Changes \[#changes-8]

* Consumed new version of Sync JS SDK version 0.10.3
* Link to the token generation material got updated

***

### Programmable Chat 3.2.2 *(April 2, 2019)*

* [js](https://media.twiliocdn.com/sdk/js/chat/releases/3.2.2/twilio-chat.js)
* [min](https://media.twiliocdn.com/sdk/js/chat/releases/3.2.2/twilio-chat.min.js)
* [docs](https://media.twiliocdn.com/sdk/js/chat/releases/3.2.2/docs/)

#### Bug Fixes \[#bug-fixes-6]

* Fixed a bug where sending messages while offline caused duplicate messages at network reconnect

***

### Programmable Chat 3.2.1 *(February 21, 2019)*

* [js](https://media.twiliocdn.com/sdk/js/chat/releases/3.2.1/twilio-chat.js)
* [min](https://media.twiliocdn.com/sdk/js/chat/releases/3.2.1/twilio-chat.min.js)
* [docs](https://media.twiliocdn.com/sdk/js/chat/releases/3.2.1/docs/)

#### Bug Fixes \[#bug-fixes-7]

* Improved error handling in operations with `User`, `Member`, `Channel`, `Message`

***

### Programmable Chat 3.2.0 *(December 7, 2018)*

* [js](https://media.twiliocdn.com/sdk/js/chat/releases/3.2.0/twilio-chat.js)
* [min](https://media.twiliocdn.com/sdk/js/chat/releases/3.2.0/twilio-chat.min.js)
* [docs](https://media.twiliocdn.com/sdk/js/chat/releases/3.2.0/docs/)

#### Overview

In this release we are introducing Member Attributes and the ability to change them.

#### Changes \[#changes-9]

* Added `dateCreated`, `dateUpdated`, `type`, and `attributes` properties to `Member` class
* Added `Member.updateAttributes` method to set a Member's Attributes (requires new permissions to be added to the according role: `editOwnMemberAttributes` or `editAnyMemberAttributes`)

#### Bug Fixes \[#bug-fixes-8]

* Fixed a connectivity bug that caused unhandled promise rejections

### Programmable Chat 3.1.0 *(October 18, 2018)*

* [js](https://media.twiliocdn.com/sdk/js/chat/releases/3.1.0/twilio-chat.js)
* [min](https://media.twiliocdn.com/sdk/js/chat/releases/3.1.0/twilio-chat.min.js)
* [docs](https://media.twiliocdn.com/sdk/js/chat/releases/3.1.0/docs/)

#### Overview \[#overview-2]

In this release we are introducing a User Notification Level to each Channel. The assigned level determines whether the currently logged-in User will receive pushes for that Channel. The assigned level be any of `muted` or `default`, where `default` defers to global Chat Service push configuration.

#### Changes \[#changes-10]

* Added `Channel.setUserNotificationLevel` method to set User's Notification level
* Added `notificationLevel` property to `Channel` class

#### Bug Fixes \[#bug-fixes-9]

* Fixed a connectivity bug that caused reconnection recovery to fail, including when going into the background on iOS (react native).

### Programmable Chat 3.0.2 *(July 23, 2018)*

* [js](https://media.twiliocdn.com/sdk/js/chat/releases/3.0.2/twilio-chat.js)
* [min](https://media.twiliocdn.com/sdk/js/chat/releases/3.0.2/twilio-chat.min.js)
* [docs](https://media.twiliocdn.com/sdk/js/chat/releases/3.0.2/docs/)

#### Changes \[#changes-11]

* Improved startup and synchronization time in some cases

#### Bug Fixes \[#bug-fixes-10]

* Resolved potential issue in Channel synchronization on startup
* Fixed bug preventing building React Native apps in Release configuration

### Programmable Chat 3.0.1 *(June 25, 2018)*

* [js](https://media.twiliocdn.com/sdk/js/chat/releases/3.0.1/twilio-chat.js)
* [min](https://media.twiliocdn.com/sdk/js/chat/releases/3.0.1/twilio-chat.min.js)
* [docs](https://media.twiliocdn.com/sdk/js/chat/releases/3.0.1/docs/)

#### Changes \[#changes-12]

* Improve diagnostics, start adding timestamps to log lines

#### Bug Fixes \[#bug-fixes-11]

* `@types\loglevel` package is not required anymore in TypeScript projects using `twilio-chat`

### Programmable Chat 3.0.0 *(May 31, 2018)*

* [js](https://media.twiliocdn.com/sdk/js/chat/releases/3.0.0/twilio-chat.js)
* [min](https://media.twiliocdn.com/sdk/js/chat/releases/3.0.0/twilio-chat.min.js)
* [docs](https://media.twiliocdn.com/sdk/js/chat/releases/3.0.0/docs/)

#### Overview \[#overview-3]

In this release we have revised all *updated* events. Each revised event now receives an object which contains:

* updated object itself, i.e. `channel`, `member`, `message`, `user`
* array of reasons the event is being triggered, i.e. object is updated because of update in `attributes`, `friendlyName`, `body`, etc.

Additionally, the `Channel.LastMessage` structure is updated to contain only last message's creation `timestamp` and `index` (effectively removing `author` and `sid`)

#### Breaking Changes

* *updated* events now include reasons for the update. Changed events are:
  * `Client#event:channelUpdated`
  * `Channel#event:updated`
  * `Client#event:memberUpdated`
  * `Channel#event:memberUpdated`
  * `Member#event:updated`
  * `Client#event:messageUpdated`
  * `Channel#event:messageUpdated`
  * `Message#event:updated`
  * `Client#event:userUpdated`
  * `User#event:updated`
* Changing `channel.sendMessage()` promise resolve type to `Promise<number>`
* Default `logLevel` is now set to `silent`, log lines now includes timestamp
* Removed `sid` and `author` properties from `Channel.LastMessage` type

#### Additive Changes

* Adjust docs for `Client.shutdown()`, introducing new types for various methods
* Adding new events on client: `tokenAboutToExpire`, `tokenExpired` (essentially removing need for `AccessManager` use)
* Added `index` property to `Channel.LastMessage` type

### 2.x

For older changelog entries including 2.x, click [Changelog](/docs/chat/javascript/2x-changelog)
