Skip to content

Authentication

Authenticate with Lingo.dev to access the cloud-based translation engine.

INFO

Want to use your own AI provider?

Skip Lingo.dev authentication entirely with the Bring Your Own LLM feature. Connect your OpenAI or Anthropic API keys directly by configuring your provider in i18n.json and setting the appropriate environment variables.

Check Your Authentication Status

Verify if you're already logged in:

bash
npx lingo.dev@latest auth

This displays your authentication status and email address if you're currently logged in.

Authentication Methods

Choose between two simple authentication options:

bash
npx lingo.dev@latest auth --login

This opens your browser for a quick login and automatically redirects you back to your terminal.

INFO

If browser redirects fail due to ad blockers or security settings, use the environment variable method instead.

2. API Key (Best for CI/CD and Headless Environments)

Set your API key as an environment variable:

bash
export LINGODOTDEV_API_KEY=your_api_key_here

Or add it to a .env file in your project root:

bash
LINGODOTDEV_API_KEY=your_api_key_here

WARNING

Always add .env to your .gitignore to prevent exposing your API key.

Logging Out

Remove your local authentication:

bash
npx lingo.dev@latest auth --logout

This clears your stored token, requiring re-authentication for future commands.

Note: When using environment variables, simply unset the variable to "log out."

Why We Offer Two Methods

Our dual authentication approach gives you flexibility:

  1. Browser login provides a seamless experience without managing API keys
  2. Environment variables enable automation in CI/CD pipelines and headless environments

Choose the method that best fits your workflow and security requirements.

External Provider Authentication

When using your own AI provider, set up provider-specific authentication:

OpenAI

bash
export OPENAI_API_KEY=your_openai_api_key

Anthropic

bash
export ANTHROPIC_API_KEY=your_anthropic_api_key

Use these alongside or instead of Lingo.dev authentication, depending on your configuration.

Security Best Practices

  1. Never commit API keys to version control
  2. Add .env files to your .gitignore
  3. Rotate API keys regularly
  4. Use environment variables in CI/CD pipelines

Following these authentication methods and security practices ensures a secure integration with Lingo.dev, whether you're working locally or in automated environments.