'use client'; import { useState } from 'react'; import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/Card'; import { Send, CheckCircle, XCircle, Clock } from 'lucide-react'; export default function WebhookTestingPage() { const [url, setUrl] = useState(''); const [method, setMethod] = useState('POST'); const [headers, setHeaders] = useState('{"Content-Type": "application/json"}'); const [payload, setPayload] = useState('{"event": "test", "data": {}}'); const [testResult, setTestResult] = useState(null); const [isTesting, setIsTesting] = useState(false); const testWebhook = async () => { setIsTesting(true); setTestResult(null); try { const startTime = Date.now(); const response = await fetch('/api/webhooks/test', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ url, method, headers: JSON.parse(headers), payload: JSON.parse(payload), }), }); const endTime = Date.now(); const data = await response.json(); setTestResult({ success: response.ok, status: response.status, statusText: response.statusText, responseTime: endTime - startTime, response: data, timestamp: new Date().toISOString(), }); } catch (error: any) { setTestResult({ success: false, error: error.message, timestamp: new Date().toISOString(), }); } finally { setIsTesting(false); } }; return (

Webhook Testing Tool

Test your webhook endpoints before configuring them

Webhook Configuration
setUrl(e.target.value)} placeholder="https://example.com/webhook" className="w-full px-4 py-2 bg-gray-900 border border-gray-700 rounded text-white" />