Support Chat Widget
A WalkMe-style floating chat widget for in-app support with context capture, screenshots, and ticket submission.
Live Demo
Click the chat button in the bottom-right corner to open the support widget.
Support
How can we help?
Select the type of issue you're experiencing:
Features
Issue Categorization
Users select from predefined categories (Bug, Question, Feature Request, Other) to help route tickets to the right team.
Priority Levels
Low, Medium, and High priority options help support teams triage and prioritize incoming requests.
Screenshot Capture
Capture the current page state or upload an image to provide visual context for the issue.
Automatic Context
Captures browser info, screen size, current URL, and timestamp automatically for debugging.
Chat Interface
Real-time messaging interface for back-and-forth communication with support agents.
Ticket Submission
Creates a support ticket with all collected information and provides a ticket ID for tracking.
What Support Teams Receive
Each ticket submitted through the widget includes:
| Field | Description | Example |
|---|---|---|
| name | User's name | John Doe |
| User's email for follow-up | john@example.com | |
| category | Issue type | bug | question | feature | other |
| priority | Urgency level | low | medium | high |
| subject | Brief issue summary | Cannot save form data |
| description | Detailed explanation | When I click save, nothing happens... |
| screenshot | Base64 image data | data:image/png;base64,... |
| context.url | Page where issue occurred | https://app.example.com/dashboard |
| context.userAgent | Browser and OS info | Mozilla/5.0 (Windows NT 10.0...) |
| context.screenSize | Viewport dimensions | 1920x1080 |
| context.timestamp | When ticket was created | 2024-01-15T10:30:00.000Z |
| messages | Chat conversation history | [{type, content, timestamp}...] |
Implementation
Basic Usage
import { SupportChatWidget } from '@/components/SupportChatWidget';
function App() {
return (
<div>
<YourAppContent />
{/* Add the widget - it floats in the corner */}
<SupportChatWidget />
</div>
);
}Connecting to Your Backend
Replace the simulated API call with your actual ticket submission endpoint:
const submitTicket = async () => {
const ticket: TicketData = {
name,
email,
category,
priority,
subject,
description,
screenshot,
context,
messages,
};
// Replace with your API endpoint
const response = await fetch('/api/support/tickets', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(ticket),
});
const { ticketId } = await response.json();
setTicketId(ticketId);
setView('submitted');
};Adding Real Screenshot Capture
Install html2canvas for actual screenshot capture:
npm install html2canvasimport html2canvas from 'html2canvas';
const captureScreenshot = async () => {
setIsCapturing(true);
try {
// Hide the widget temporarily
const widget = document.querySelector('[data-support-widget]');
if (widget) widget.style.display = 'none';
const canvas = await html2canvas(document.body, {
useCORS: true,
allowTaint: true,
scale: 0.5, // Reduce size
});
const dataUrl = canvas.toDataURL('image/png');
setScreenshot(dataUrl);
// Show widget again
if (widget) widget.style.display = '';
} catch (error) {
console.error('Screenshot failed:', error);
} finally {
setIsCapturing(false);
}
};Pre-filling User Information
If you have user authentication, pre-fill the form:
interface SupportChatWidgetProps {
user?: {
name: string;
email: string;
};
}
export function SupportChatWidget({ user }: SupportChatWidgetProps) {
const [name, setName] = useState(user?.name || '');
const [email, setEmail] = useState(user?.email || '');
// ...
}Integration Options
ServiceNow
Submit tickets directly to ServiceNow using their REST API. Map fields to your incident table schema.
Jira Service Management
Create issues in Jira with attachments and custom fields for your support workflow.
Zendesk
Use Zendesk's Tickets API to create support requests with full context and attachments.
Slack
Post tickets to a Slack channel for immediate visibility and quick response from your team.
Customization Ideas
- •Custom categories: Add application-specific issue types
- •File attachments: Allow multiple file uploads beyond screenshots
- •Knowledge base: Show relevant help articles before ticket submission
- •Live chat: Connect to a real-time chat service like Intercom or Drift
- •Session recording: Integrate with tools like FullStory or LogRocket
- •Console logs: Capture recent console errors for debugging
- •Network requests: Include failed API calls in the context
Source Files
- src/components/examples/SupportChatWidget.tsx
- src/pages/examples/support-chat.astro