sulla
sulla copied to clipboard
how to get status of session?
I have an api rest with express and I have a route to create new sessions but I would like to know if a connection has already been created and if so, then delete it and create it again
I would like to know too.
there must be client.state()
but you can grab session state by trying this
client.onStateChange((state) => { console.log(state); const conflits = [ sulla.SocketState.CONFLICT, sulla.SocketState.UNPAIRED, sulla.SocketState.UNLAUNCHED, ]; if (conflits.includes(state)) { client.useHere(); } }); `
the repository is deprecated use
Install npm i @s2click/venom https://github.com/s2click/venom