Usage
Check an EndUser's connection status
Sometimes, it is useful to check whether an EndUser’s IntegrationConnection is working. For example, you might want to display a “connection status” indicator in your app’s UI.
To do this, you can use the method conductor.endUsers.ping()
to check whether the specified IntegrationConnection can connect and process requests end-to-end. If an error occurs, we strongly recommend displaying the property error.userFacingMessage
to your EndUser in your app’s UI because it contains instructions for how your EndUser can resolve the error.
try {
await conductor.endUsers.ping(endUserId, "quickbooks_desktop");
} catch (error) {
if (error instanceof ConductorError) {
// Update your app's UI to display `error.userFacingMessage`, which explains
// that the connection is failing and how to resolve the error.
}
// ...
}