Learn how to integrate Nexva AI Chat widget into your website
Add these two lines of code before the closing </body> tag:
<!-- Add this before closing </body> tag -->
<script src="https://cdn.nexva.ai/widget.js"></script>
<script>
NexvaChat.init('YOUR_API_KEY', {
position: 'bottom-right',
primaryColor: '#32f08c',
welcomeMessage: 'Hi! How can I help you today?',
enableVoice: true,
enableHumanSupport: true
});
</script>💡 Pro Tip: Get your API key from the API Tokens page
// npm install nexva-react
import { NexvaChat } from 'nexva-react';
export default function App() {
return (
<div>
<h1>Your App Content</h1>
<NexvaChat
config={{
apiKey: 'YOUR_API_KEY',
position: 'bottom-right',
primaryColor: '#32f08c',
enableVoice: true,
enableHumanSupport: true
}}
/>
</div>
);
}// npm install nexva-react
// app/layout.tsx or pages/_app.tsx
import { NexvaChatNext } from 'nexva-react';
export default function RootLayout({ children }) {
return (
<html>
<body>
{children}
<NexvaChatNext
config={{
apiKey: 'YOUR_API_KEY',
position: 'bottom-right',
primaryColor: '#32f08c',
enableVoice: true,
enableHumanSupport: true
}}
/>
</body>
</html>
);
}<?php
// Add to functions.php
function nexva_chat_widget() {
$api_key = 'YOUR_API_KEY';
?>
<script src="https://cdn.nexva.ai/widget.js"></script>
<script>
NexvaChat.init('<?php echo $api_key; ?>', {
position: 'bottom-right',
primaryColor: '#32f08c',
enableVoice: true
});
</script>
<?php
}
add_action('wp_footer', 'nexva_chat_widget');
?>{{-- resources/views/layouts/app.blade.php --}}
<!DOCTYPE html>
<html>
<head>
<title>@yield('title')</title>
</head>
<body>
@yield('content')
<script src="https://cdn.nexva.ai/widget.js"></script>
<script>
NexvaChat.init('{{ config('services.nexva.api_key') }}', {
position: 'bottom-right',
primaryColor: '#32f08c'
});
</script>
</body>
</html>// main.js or App.vue
export default {
mounted() {
const script = document.createElement('script');
script.src = 'https://cdn.nexva.ai/widget.js';
script.async = true;
script.onload = () => {
window.NexvaChat.init('YOUR_API_KEY', {
position: 'bottom-right',
primaryColor: '#32f08c'
});
};
document.body.appendChild(script);
}
}| Option | Type | Default | Description |
|---|---|---|---|
| apiKey | string | - | Required. Your chatbot API key |
| apiUrl | string | https://api.nexva.ai | Your backend API URL |
| position | string | bottom-right | bottom-right, bottom-left |
| primaryColor | string | #32f08c | Brand color (hex code) |
| welcomeMessage | string | Hi! How can I help... | Initial greeting message |
| placeholder | string | Type your message... | Input placeholder text |
| enableVoice | boolean | true | Enable voice chat tab |
| enableHumanSupport | boolean | true | Show "Talk to Human" button |
| autoOpen | boolean | false | Auto-open chat on page load |
| borderRadius | string | 12px | Border radius for widget (e.g., '0px' for square) |
| buttonSize | string | 60px | Size of the chat button |
| buttonColor | string | primaryColor | Chat button color (defaults to primaryColor) |
| headerText | string | Nexva | Header title text |
| theme | string | light | light, dark |
NexvaChat.init('your-api-key', {
primaryColor: '#667eea', // Purple theme
buttonColor: '#ed64a6' // Pink button
});NexvaChat.init('your-api-key', {
borderRadius: '0px', // Square corners
buttonSize: '70px' // Larger button
});NexvaChat.init('your-api-key', {
// Colors
primaryColor: '#10b981',
buttonColor: '#059669',
// Size & Shape
buttonSize: '65px',
borderRadius: '8px',
// Position
position: 'bottom-left',
// Text Content
headerText: 'Support Team',
welcomeMessage: 'Hello! How can we help?',
placeholder: 'Type your question...',
// Features
enableVoice: true,
enableHumanSupport: true,
autoOpen: false
});Full AI-powered chat with streaming responses and markdown support
Real-time speech recognition for hands-free interaction
Escalate to human support team with one click
Match your brand with custom colors and messages
Works perfectly on desktop, tablet, and mobile devices
Lightweight, fast-loading with no external libraries
Chrome 90+
Firefox 88+
Safari 14+
Edge 90+
Voice chat requires Speech Recognition API (Chrome, Edge, Safari)