
The Contact Support functionality allows you to provide user support whenever a user clicks the Contact Support button. This button is displayed only if the user is authenticated and all the necessary steps to enable this module have been completed.
The button is shown whenever an error is displayed, and its behavior is managed through the onAction callback.
To enable the Contact Support Button within your Virtual Stadium widget, set the enableContactSupportButton property to true during widget initialization:
enableContactSupportButton boolean optional
Enables the Contact Support Button functionality.
Enable Contact Support Button:
SIR('addWidget', '#sr-vs-widget', 'virtualStadium', {
enableContactSupportButton: true,
...restProps
});When a user clicks on a contact support button, an action is triggered. This action invokes the onAction callback and returns the following data structure:
onAction (type: string, data: object) => void optional
Callback function triggered when specific events occur in the widget.
Parameters:
type string required
Action type: "ContactSupport".
data object required
Action data containing error information.
data.channelId string required
Unique identifier of the chat channel where the error occurred.
data.error object required
Error information object containing details about the error that triggered the support request.
Handling Contact Support Actions:
function onAction(type, data) {
switch (type) {
case 'ContactSupport': {
const { channelId, error } = data;
// IMPORTANT: Implement your support workflow
// - Open a support chat/ticket system
// - Send error details to your support team
// - Provide user with immediate assistance options
// - Log the incident for quality monitoring
// Example: Open support chat or redirect to help page
// window.open('/support?channel=' + channelId, '_blank');
// Example: Send error to your logging/monitoring system
// logErrorToService(error, channelId);
break;
}
default: {
console.log('Unhandled action type:', type);
}
}
}
SIR('addWidget', '#sr-vs-widget', 'virtualStadium', {
enableContactSupportButton: true,
onAction: onAction,
...restProps
});