Embed AI in Any Application
Developer-first SDK for seamless AI integration. Build applications withAI avatars, deploy agents from our marketplace, and integrate security automation. Production-ready tools, comprehensive TypeScript support, and framework-specific optimizations.
5-Minute Quickstart
Step 1: Install SDK
Add the Swfte SDK to your project
npm install @swfte/sdk
Framework Integrations
Purpose-built SDKs for your favorite frameworks and libraries.
React Integration
import { useSwfte } from '@swfte/react';
function ChatComponent() {
const { createChat, loading } = useSwfte();
const handleMessage = async (message) => {
const response = await createChat({
agent: 'support-bot',
message: message,
stream: true
});
return response;
};
return (
<div className="chat-container">
{/* Your chat UI */}
</div>
);
}
npm install @swfte/react
Features Included
Built for Developers
Everything you need to build, test, and deploy AI-powered applications with production-ready SDKs. Comprehensive developer tools, enterprise-grade security, and intelligent automation capabilities for modern software development.
Lightning Fast Integration
Get up and running in minutes with our developer-first SDK. Intuitive APIs, comprehensive TypeScript support, and zero-config setup.
- One-line initialization
- Auto-generated TypeScript types
- Hot module replacement support
- Built-in error handling
Framework Agnostic
Works seamlessly with React, Vue, Angular, Svelte, or vanilla JavaScript. Purpose-built SDKs for each framework with idiomatic patterns.
- React hooks and components
- Vue 3 composables
- Angular services and pipes
- Svelte stores and actions
Production Ready
Enterprise-grade security, comprehensive error handling, and built-in monitoring. Designed for scale from prototype to production.
- Automatic retry logic
- Circuit breaker pattern
- Request/response middleware
- Built-in analytics
Optimized Performance
Minimal bundle size, intelligent caching, and streaming responses. Optimized for both developer experience and end-user performance.
- Tree-shakeable modules
- Automatic response caching
- WebSocket streaming
- Background sync
Integration Patterns
Choose the right integration pattern for your architecture.
Frontend Integration
Embed AI directly into your React, Vue, or Angular applications with real-time streaming and beautiful UI components.
Use Cases:
Backend Integration
Integrate AI processing into your Node.js, Python, or Go backends with robust error handling and scalable patterns.
Use Cases:
Webhook Integration
Set up event-driven AI workflows that respond to external events and integrate with your existing systems.
Use Cases:
Production Examples
Real-world examples you can copy and customize.
import { useSwfte, StreamingResponse } from '@swfte/react';
import { useState } from 'react';
interface Message {
id: string;
content: string;
role: 'user' | 'assistant';
timestamp: Date;
}
export function ChatComponent() {
const [messages, setMessages] = useState<Message[]>([]);
const [input, setInput] = useState('');
const { stream, loading } = useSwfte();
const sendMessage = async () => {
if (!input.trim()) return;
const userMessage: Message = {
id: crypto.randomUUID(),
content: input,
role: 'user',
timestamp: new Date()
};
setMessages(prev => [...prev, userMessage]);
setInput('');
const assistantMessage: Message = {
id: crypto.randomUUID(),
content: '',
role: 'assistant',
timestamp: new Date()
};
setMessages(prev => [...prev, assistantMessage]);
await stream({
agent: 'support-agent',
message: input,
onChunk: (chunk) => {
setMessages(prev => prev.map(msg =>
msg.id === assistantMessage.id
? { ...msg, content: msg.content + chunk }
: msg
));
}
});
};
return (
<div className="chat-container">
<div className="messages">
{messages.map(message => (
<div key={message.id} className={message.role}>
{message.content}
</div>
))}
</div>
<div className="input-area">
<input
value={input}
onChange={(e) => setInput(e.target.value)}
onKeyPress={(e) => e.key === 'Enter' && sendMessage()}
placeholder="Type your message..."
disabled={loading}
/>
<button onClick={sendMessage} disabled={loading}>
Send
</button>
</div>
</div>
);
}
import { SwfteClient } from '@swfte/node';
import { NextApiRequest, NextApiResponse } from 'next';
const client = new SwfteClient({
apiKey: process.env.SWFTE_API_KEY!,
environment: 'production'
});
export default async function handler(
req: NextApiRequest,
res: NextApiResponse
) {
if (req.method !== 'POST') {
return res.status(405).json({ error: 'Method not allowed' });
}
try {
const { message, userId, agentId } = req.body;
// Validate input
if (!message || !userId || !agentId) {
return res.status(400).json({
error: 'Missing required fields'
});
}
// Create chat completion
const response = await client.chat.create({
agent: agentId,
message: message,
context: {
userId: userId,
timestamp: new Date().toISOString(),
requestId: crypto.randomUUID()
},
stream: false
});
// Log for analytics
console.log('Chat completion:', {
userId,
agentId,
responseLength: response.content.length,
duration: response.metadata.duration
});
res.status(200).json({
message: response.content,
metadata: response.metadata
});
} catch (error) {
console.error('Chat API error:', error);
res.status(500).json({
error: 'Internal server error'
});
}
}
Developer Tools Included
Everything you need for a smooth development experience.
CLI Development Tools
Scaffold, test, and deploy agents from command line
Inspector & Debugger
Real-time debugging and performance profiling
Analytics Dashboard
Monitor usage, performance, and costs in real-time
Interactive Documentation
Live examples, API explorer, and tutorials
Development Workflow
swfte init my-agent
swfte dev --watch
swfte test --coverage
swfte deploy --env staging
swfte deploy --env production
Start Building with AI Today
Join 0+ developers already building with our SDK. Get started in minutes.