Overview
The Suada Vue SDK provides a seamless integration experience for Vue 3 applications. Built with the Composition API in mind, it offers components, composables, and utilities that follow Vue best practices while maintaining type safety through TypeScript.Prerequisites
- Vue 3.0.0 or higher
- Node.js 16.0.0 or higher
- A Suada API key
- TypeScript 4.5+ (recommended)
- Vite 3.0+ or Vue CLI 5.0+ (for development)
Installation
Install the Suada Vue SDK and its peer dependencies:Quick Start
Here’s a basic example to get you started:Authentication
Setting up your API Key
We recommend using environment variables with Vite:Plugin Configuration
Configure the plugin with environment-specific settings:Core Components
Chat Component
A pre-built chat interface component:Props
| Prop | Type | Required | Description |
|---|---|---|---|
| theme | ’light’ | ‘dark’ | No | UI theme (defaults to ‘light’) |
| placeholder | string | No | Input placeholder text |
| initialMessages | Message[] | No | Pre-loaded chat messages |
| privacyMode | boolean | No | Enable enhanced privacy features |
| class | string | No | Additional CSS classes |
Events
| Event | Type | Description |
|---|---|---|
| messageSubmit | (message: ChatMessage) => void | Emitted when a message is submitted |
| responseReceived | (response: ChatResponse) => void | Emitted when a response is received |
| error | (error: Error) => void | Emitted when an error occurs |
Integration Components
Integration Manager
Manage service integrations:Composables
useSuada
The main composable for accessing Suada functionality:useIntegrations
Manage integrations programmatically:Error Handling
The SDK provides comprehensive error handling:Best Practices
Security
- Store API keys in environment variables
- Use privacy mode for sensitive data
- Implement proper error handling
- Secure OAuth callback endpoints
Performance
- Use proper cleanup in
onUnmounted - Implement proper error boundaries
- Use Vue’s built-in caching mechanisms
- Optimize network requests
Development
- Use TypeScript for better type safety
- Follow Vue style guide
- Write unit tests
- Keep dependencies updated
FAQ
How do I handle environment-specific configuration?
Use Vite’s environment variables:How do I customize component themes?
Use CSS variables and custom classes:How do I implement retry logic?
Configure retry behavior in the plugin:How can I debug the SDK?
Enable debug mode in your configuration:How do I use the SDK with Nuxt?
For Nuxt 3, create a plugin:Support & Resources
Documentation
Community & Help
- GitHub Issues: Report a bug
- Email Support: support@suada.ai
- Discord: Join our community