-
Notifications
You must be signed in to change notification settings - Fork 17
Open
0 / 10 of 1 issue completedDescription
We have had some transient errors that threw a SessionAuthError and then disconnects the client using valid credentials.
We are working around this by utilizing the client exposed by the package, but appears undocumented at https://developer.signalwire.com/sdks/reference/realtime-sdk/relay-v4.
import { SignalWire } from "@signalwire/realtime-api";
const relayClient = await SignalWire({ project: "ProjectID Here", token: "Token Here" })
const client = relayClient.client
const onAuthError = async () => {
// do something when authError is thrown
}
// is the client session connected?
if (client?.store?.getState?.()?.session?.authStatus === 'authorized') {
// handle state when session throws an authError instead of silently disconnecting.
client.session.addListener('session.auth_error', onAuthError)
}
Is utilizing this client in such a way considered supported? If not, are their plans to expose session events like session.auth_error and the current session authStatus?
Sub-issues
Metadata
Metadata
Assignees
Labels
No labels