You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: replace StreamChatGenerics with module augmentation (#1458)
fix: `channel_role` has been removed from the type of the `members`
parameter of the `Channel.inviteMembers` method
fix: properties `created_by` and `created_by_id` have been added to
`ChannelData` and `ChannelQueryOptions` types
BREAKING CHANGE: dropped jsDelivr bundle (#1468)
BREAKING CHANGE: dropped `StreamChatGenerics`, use `Custom<Entity>Data` to extend your
types
BREAKING CHANGE: type `InviteOptions` has been renamed to `UpdateChannelOptions`
BREAKING CHANGE: type `UpdateChannelOptions` has been renamed to
`UpdateChannelTypeRequest`
BREAKING CHANGE: type `ThreadResponseCustomData` has been renamed to `CustomThreadData`
BREAKING CHANGE: type `MarkAllReadOptions` has been deleted in favour of type
`MarkChannelsReadOptions`
BREAKING CHANGE: type `QueryFilter` no longer supports `$ne` and `$nin` operators
BREAKING CHANGE: type `ChannelMembership` has been deleted in favour of type
`ChannelMemberResponse`
BREAKING CHANGE: function `formatMessage` (`utils.ts`) no longer returns `__html`
property in the formatted message output
Copy file name to clipboardExpand all lines: README.md
+59-65Lines changed: 59 additions & 65 deletions
Original file line number
Diff line number
Diff line change
@@ -20,7 +20,7 @@
20
20
21
21
You can sign up for a Stream account at our [Get Started](https://getstream.io/chat/get_started/) page.
22
22
23
-
This library can be used by both frontend and backend applications. For frontend, we have frameworks that are based on this library such as the [Flutter](https://github.com/GetStream/stream-chat-flutter), [React](https://github.com/GetStream/stream-chat-react) and [Angular](https://github.com/GetStream/stream-chat-angular) SDKs. For more information, check out our [docs](https://getstream.io/chat/docs/).
23
+
This library can be used by both frontend and backend applications. For frontend, we have frameworks that are based on this library such as the [Flutter](https://github.com/GetStream/stream-chat-flutter), [React](https://github.com/GetStream/stream-chat-react) and [Angular](https://github.com/GetStream/stream-chat-angular) SDKs. For more information, check out our [documentation](https://getstream.io/chat/docs/).
disableCache: true, // recommended option for server-side use
48
+
// ...other options like `baseURL`...
49
+
});
46
50
47
-
The StreamChat client is setup to allow extension of the base types through use of generics when instantiated. The default instantiation has all generics set to `Record<string, unknown>`.
The `StreamChat` client is set up to allow extension of the base types through use of module augmentation, custom types will carry through to all client returns and provide code-completion to queries (if supported). To extend Stream's entities with custom data you'll have to create a declaration file and make sure it's loaded by TypeScript, [see the list of extendable interfaces](https://github.com/GetStream/stream-chat-js/blob/master/src/custom_types.ts) and the example bellow using two of the most common ones:
// property `custom_property` is code-completed and expects type `number | undefined`
90
+
const { message } =awaitchannel.sendMessage({ text: 'This is another test message', custom_property: 255 });
91
+
92
+
message.custom_property; // in the response object as well
100
93
```
101
94
102
-
Custom types provided when initializing the client will carry through to all client returns and provide intellisense to queries.
95
+
> [!WARNING]
96
+
> Generics mechanism has been removed in version `9.0.0` in favour of the module augmentation, please see [the release guide](https://getstream.io/chat/docs/node/upgrade-stream-chat-to-v9) on how to migrate.
103
97
104
-
## 🔗 (Optional) Development Setup in Combination with our SDKs
98
+
## 🔗 (Optional) Development Setup in Combination With Our SDKs
105
99
106
100
### Connect to [Stream Chat React Native SDK](https://github.com/GetStream/stream-chat-react-native)
107
101
108
-
Run in the root of this repo
102
+
Run in the root of this repository:
109
103
110
-
```shell
104
+
```sh
111
105
yarn link
112
106
```
113
107
114
-
Run in the root of one of the example apps (SampleApp/TypeScriptMessaging) in the `stream-chat-react-native`repo
108
+
Run in the root of one of the example applications (SampleApp/TypeScriptMessaging) in the `stream-chat-react-native`repository:
115
109
116
-
```shell
110
+
```sh
117
111
yarn link stream-chat
118
112
yarn start
119
113
```
120
114
121
-
Open `metro.config.js` file and set value for watchFolders as
115
+
Open `metro.config.js` file and set value for `watchFolders` as:
Make sure to replace `{{CHANGE_TO_THE_PATH_TO_YOUR_PROJECT}}` with the correct path for the `stream-chat-js` folder as per your directory structure.
136
+
Make sure to replace `<PATH TO YOUR PROJECT>` with the correct path for the `stream-chat-js` folder as per your directory structure.
143
137
144
-
Run in the root of this repo
138
+
Run in the root of this repository:
145
139
146
-
```shell
140
+
```sh
147
141
yarn start
148
142
```
149
143
150
-
## 📚 More code examples
144
+
## 📚 More Code Examples
151
145
152
-
Head over to [docs/typescript.md](./docs/typescript.md) for more examples.
146
+
Read up more on [Logging](./docs/logging.md) and [User Token](./docs/userToken.md) or visit our [documentation](https://getstream.io/chat/docs/) for more examples.
153
147
154
148
## ✍️ Contributing
155
149
156
150
We welcome code changes that improve this library or fix a problem, please make sure to follow all best practices and add tests if applicable before submitting a Pull Request on Github. We are very happy to merge your code in the official repository. Make sure to sign our [Contributor License Agreement (CLA)](https://docs.google.com/forms/d/e/1FAIpQLScFKsKkAJI7mhCr7K9rEIOpqIDThrWxuvxnwUq2XkHyG154vQ/viewform) first. See our [license file](./LICENSE) for more details.
157
151
158
152
Head over to [CONTRIBUTING.md](./CONTRIBUTING.md) for some development tips.
159
153
160
-
## 🧑💻 We are hiring!
154
+
## 🧑💻 We Are Hiring!
161
155
162
156
We've recently closed a [$38 million Series B funding round](https://techcrunch.com/2021/03/04/stream-raises-38m-as-its-chat-and-activity-feed-apis-power-communications-for-1b-users/) and we keep actively growing.
163
157
Our APIs are used by more than a billion end-users, and you'll have a chance to make a huge impact on the product within a team of the strongest engineers all over the world.
0 commit comments