Repository navigation
Recipes
Mcdavid Obioha edited this page Dec 2, 2026
·
2 revisions
Copy, paste, adjust. Each recipe is a complete <WhatsAppChat> element.
<WhatsAppChat phoneNumber="+12025550123" /><WhatsAppChat phoneNumber="+12025550123" variant="icon" theme="brand" position="bottom-left" /><WhatsAppChat
phoneNumber="+12025550123"
title="Quick question?"
fields={{ name: false, subject: false }}
hint="Typically replies within an hour."
submitLabel="Send on WhatsApp"
/><WhatsAppChat
title="Talk to us"
agents={[
{ id: 'sales', name: 'Ada Obi', role: 'Sales', phoneNumber: '+2348011111111' },
{ id: 'support', name: 'Tunde Bello', role: 'Support', phoneNumber: '+2348022222222' },
]}
businessHours={{
timezone: 'Africa/Lagos',
schedule: { mon: ['09:00', '17:00'], tue: ['09:00', '17:00'], wed: ['09:00', '17:00'], thu: ['09:00', '17:00'], fri: ['09:00', '17:00'] },
offlineMessage: 'We reply Monday to Friday, 9am to 5pm WAT.',
}}
/><WhatsAppChat
phoneNumber="+12025550123"
includePageContext
onSend={({ page }) => analytics.track('whatsapp_lead', { url: page?.url, source: page?.utm.utm_source })}
/>const [open, setOpen] = useState(false);
<button onClick={() => setOpen(true)}>Chat with us</button>
<WhatsAppChat phoneNumber="+12025550123" isOpen={open} onOpenChange={setOpen} /><WhatsAppChat
phoneNumber="+12025550123"
variant="icon"
showAfter={{ ms: 4000, scrollPercent: 20 }}
greeting="Chat with us 👋"
showNotificationDot
/><WhatsAppChat
phoneNumber="+12025550123"
defaultMessage={`Hi, I'm interested in ${product.name}.`}
fields={{ subject: false }}
/><WhatsAppChat phoneNumber="+12025550123" hideOnPaths={['/checkout/*', '/account/*', '/login']} /><WhatsAppChat phoneNumber="+12025550123" theme="auto" /><WhatsAppChat phoneNumber="+12025550123" accentColor="#6d28d9" />Or site-wide, with CSS:
:root { --wa-primary: #6d28d9; --wa-radius: 1.25rem; }See Right-to-Left and Translations for the full example.
<WhatsAppChat
phoneNumber="+12025550123"
messageTemplate={({ name, subject, message }) => `[Website enquiry]\nFrom: ${name}\nAbout: ${subject}\n\n${message}`}
/><WhatsAppChat phoneNumber="+12025550123" includePageContext webhookUrl="https://hooks.example.com/whatsapp-lead" />See Lead Webhooks for the payload and recipes for n8n, Make, Zapier, Slack and HubSpot.
<WhatsAppWidgetProvider>
<WhatsAppChat agents={agents} />
<PlanButton plan="Pro" /> {/* calls useWhatsAppWidget().openWithDraft({ subject: 'Pro plan', ... }) */}
</WhatsAppWidgetProvider>const ai = createOpenAICompatibleAI({ endpoint: '/api/whatsapp-ai', model: 'gpt-4.1-mini', enableRouting: true });
<WhatsAppChat agents={agents} ai={ai} />See Bring Your Own AI and Backend Recipes.
const transport = createWebhookTransport({ sendUrl: '/n8n/chat-send', pollUrl: '/n8n/chat-replies' });
<WhatsAppChat phoneNumber="+12025550123" transport={transport} widgetId="support" />See Live Chat.
<script src="https://cdn.jsdelivr.net/npm/whatsapp-chat-widget-react@0.8.0/dist/standalone.global.js"
data-phone="+12025550123" data-theme="brand" defer></script>See Script-Tag Build.