Skip to content

Commit 5626dbb

Browse files
handle users
1 parent 0649a6b commit 5626dbb

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

packages/node-sdk/src/storage.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,21 @@ export class StreamStorage {
238238
return channel.messages || [];
239239
}
240240

241+
async upsertUsers(): Promise<string> {
242+
const id = generateChannelId();
243+
await this.client.upsertUsers([
244+
{
245+
id,
246+
role: "user",
247+
},
248+
{
249+
id: this.botUserId,
250+
role: "user",
251+
},
252+
]);
253+
return id;
254+
}
255+
241256
/**
242257
* Gets the Stream Chat client instance
243258
*/

0 commit comments

Comments
 (0)