Skip to main content

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​

PackageDescriptionWhen to use
@lingva/coreCore API clientAny JavaScript project
@lingva/reactReact hooks & componentsReact, Next.js, Remix
@lingva/vueVue composablesVue 3
@lingva/nextNext.js integrationNext.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​

🆘 Troubleshooting​

Common issues​

IssueSolution
Cannot find module '@lingva/react'Make sure package is installed and you're using npm/yarn/pnpm correctly
API key not foundCheck environment variables and API key format
CORS errorsAdd your domain to allowed origins in Lingva dashboard
TypeScript errorsUpdate TypeScript to version 5.0 or later

Getting help​