JSFiddle - React, Tailwind, and code Playground
HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>My Website</title>
<link rel="stylesheet" href="./style.css">
<link rel="icon" href="./favicon.ico" type="image/x-icon">
</head>
<body>
<main>
<h1>Welcome to My Website</h1>
</main>
<script src="https://cdn.botpress.cloud/webchat/v1/inject.js"></script>
<script>
let userLanguage = navigator.language || 'en-US';
let userTimeZone = Intl.DateTimeFormat().resolvedOptions().timeZone;
let currentDateTime = new Date().toISOString();
console.log('Date time: ', currentDateTime);
console.log('Time zone: ', userTimeZone);
console.log('Language: ', userLanguage);
window.botpressWebChat.init({
"composerPlaceholder": "Chat with bot",
"botConversationDescription": "This chatbot was built surprisingly fast with Botpress",
"botId": "c3d72c4a-974c-49b9-a735-983acbfc4993",
"hostUrl": "https://cdn.botpress.cloud/webchat/v1",
"messagingUrl": "https://messaging.botpress.cloud",
"clientId": "c3d72c4a-974c-49b9-a735-983acbfc4993",
"webhookId": "d0df9831-1f74-4bd8-a9ee-f771f40183b7",
"lazySocket": true,
"themeName": "prism",
"frontendVersion": "v1",
"showPoweredBy": true,
"enableConversationDeletion": true,
"theme": "prism",
"themeColor": "#2563eb",
"userData": {
"userLanguage": userLanguage,
"userTimeZone": userTimeZone,
"currentDateTime": currentDateTime,
"currentYear": new Date().getFullYear().toString(),
"currentMonth": (new Date().getMonth() + 1).toString(),
"currentDay": new Date().getDate().toString(),
"timeString": new Date().toLocaleTimeString(),
...