Appearance
Node.js SDK
Official Node.js SDK for Converra - the AI prompt optimization platform.
Installation
bash
npm install converraQuick Start
typescript
import { Converra } from 'converra';
const converra = new Converra({
apiKey: process.env.CONVERRA_API_KEY
});
// Get your optimized prompt (cached automatically)
const prompt = await converra.prompts.get('prompt_123');
console.log(prompt.content);Requirements
- Node.js 18+
- A Converra API key (get one here)
Features
- Prompt Management - Fetch, create, and update prompts
- Conversation Logging - Log conversations for insights and optimization
- Built-in Caching - Automatic prompt caching with configurable TTL
- Webhook Handling - Type-safe webhook handlers with signature verification
- TypeScript Support - Full type definitions included
Configuration
typescript
const converra = new Converra({
apiKey: 'sk_live_...', // Required
baseUrl: 'https://converra.ai/api/v1', // Optional, for self-hosted
timeout: 30000, // Optional, request timeout in ms
cache: {
strategy: 'memory', // Optional: 'memory' or 'none'
ttl: 300000, // Optional: cache TTL in ms (default 5 min)
},
});Next Steps
- Integration Guide - Step-by-step integration patterns
- Caching - Configure and manage prompt caching
- Webhooks - Set up real-time notifications
- API Reference - Full method documentation
