Overview
Get started with Lingva in your project. Choose the integration that matches your framework.
📋 Prerequisites​
Before installing Lingva, make sure you have:
- Node.js 18.0.0 or later
- npm, yarn, or pnpm package manager
- A Lingva account and API key (Sign up free)
🎯 Quick Overview​
| Package | Description | When to use |
|---|---|---|
@lingva/core | Core API client | Any JavaScript project |
@lingva/react | React hooks & components | React, Next.js, Remix |
@lingva/vue | Vue composables | Vue 3 |
@lingva/next | Next.js integration | Next.js 13+ (App Router) |
🔧 TypeScript Support​
All Lingva packages include first-class TypeScript support with type definitions.
import type { LingvaConfig, TranslationOptions } from '@lingva/core';
// Type-safe configuration
const config: LingvaConfig = {
apiUrl: 'https://api.lingva.dev/v1',
apiKey: process.env.LINGVA_API_KEY!,
projectId: 'proj_123',
};
// Type-safe translation options
const options: TranslationOptions = {
locale: 'en',
variables: {
name: 'John', // TypeScript will check variable names
count: 5,
},
};
✅ Verification​
After installation, verify everything works:
import { LingvaClient } from '@lingva/core';
const client = new LingvaClient({
apiUrl: 'https://api.lingva.dev/v1',
apiKey: 'test-key',
projectId: 'test-project',
});
// Should return the key if API is not configured
const test = await client.t('test.key');
console.log(test); // 'test.key' (if no API key)
🚀 Next Steps​
- Installation — Create your first project
🆘 Troubleshooting​
Common issues​
| Issue | Solution |
|---|---|
Cannot find module '@lingva/react' | Make sure package is installed and you're using npm/yarn/pnpm correctly |
API key not found | Check environment variables and API key format |
CORS errors | Add your domain to allowed origins in Lingva dashboard |
TypeScript errors | Update TypeScript to version 5.0 or later |
Getting help​
- Open an issue on GitHub