3 Commits

Author SHA1 Message Date
f54e76ab72 Updated extraMetadata to allow any type of data
All checks were successful
Setup testing environment and test the code / build (push) Successful in 26s
Publish to NPM / build-and-publish (release) Successful in 18s
2026-04-15 16:11:01 +02:00
fb1555338d Update WS
Some checks failed
Publish to NPM / build-and-publish (release) Successful in 27s
Setup testing environment and test the code / build (push) Has been cancelled
2026-04-14 16:44:27 +02:00
c98c917594 Update WS 2026-04-14 16:44:19 +02:00
3 changed files with 9 additions and 2 deletions

View File

@@ -1,6 +1,6 @@
{
"name": "@chatenium/chatenium-sdk",
"version": "1.1.9",
"version": "1.1.11",
"description": "A library for interacting with the Chatenium API",
"type": "module",
"main": "dist/index.js",

View File

@@ -43,6 +43,13 @@ export class WebSocketHandler {
this.connection = new WebSocket(`${environment.get().wsUrl}/v2/ws?userid=${userid}&access_token=${resp.data.token}`)
console.log("Connected to websocket successfully")
this.startListening()
this.connection.onclose = () => {
console.error("The WebSocket connection was closed unexpectedly. Reconnecting...")
setTimeout(() => {
this.connect(userid, token)
}, 3000)
}
return
} catch (e) {
console.log(e)

View File

@@ -24,5 +24,5 @@ export interface Attachment {
path: string
height: number
width: number
extraMetaData: Record<string, string> // Used by clients
extraMetaData: Record<string, any> // Used by clients
}