npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

transia

v0.1.1

Published

Enterprise-grade BYOK AI translation CLI for React/Next.js applications

Readme

Transia

Enterprise-grade BYOK (Bring Your Own Key) AI translation CLI for React and Next.js applications.

Transia extracts user-facing strings from your TSX/JSX source files, translates them using your AI provider of choice, and generates locale files compatible with next-intl or i18next.

Features

  • BYOK - Uses your own API keys. Keys are loaded from .env files, never stored or transmitted.
  • Intelligent AST Parsing - Babel-powered extraction of translatable strings from JSX/TSX, including JSX text, string literals, template literals, and translatable attributes.
  • Delta Translation - SHA-256 fingerprinting detects new and changed strings so you only pay to translate what changed.
  • Multiple AI Providers - OpenAI, Anthropic, Google Gemini, and xAI Grok.
  • Multiple Output Formats - next-intl (flat JSON) and i18next (namespaced JSON).
  • Security First - API keys are scrubbed from memory after use, secrets are redacted from logs and AI prompts, atomic file writes prevent corruption.

Installation

npm install -g transia

Or use it directly with npx:

npx transia init

Requires Node.js 20 or later.

Quick Start

1. Initialize

cd your-react-project
transia init

This creates a transia.config.json in your project root with sensible defaults.

2. Add your API key

Add the API key for your chosen provider to your .env or .env.local:

# OpenAI
OPENAI_API_KEY=sk-...

# Anthropic
ANTHROPIC_API_KEY=sk-ant-...

# Google Gemini
GEMINI_API_KEY=AIza...

# xAI Grok
XAI_API_KEY=xai-...

3. Configure target locales

Edit transia.config.json and set your target locales:

{
  "targetLocales": ["es", "fr", "de", "ja"]
}

4. Translate

transia translate

Preview what will be translated without making API calls:

transia translate --dry-run

5. Check coverage

transia status

Configuration

transia.config.json reference:

{
  "version": 1,
  "sourceLocale": "en",
  "targetLocales": ["es", "fr"],
  "provider": {
    "name": "openai",
    "model": "gpt-4o-mini",
    "apiKeyEnv": "MY_CUSTOM_KEY_VAR"
  },
  "include": ["src/**/*.{tsx,jsx}", "app/**/*.{tsx,jsx}"],
  "exclude": ["**/*.test.*", "**/*.spec.*", "**/node_modules/**"],
  "output": {
    "format": "next-intl",
    "path": "locales"
  }
}

| Field | Description | |---|---| | sourceLocale | Source language code (e.g. "en") | | targetLocales | Array of target locale codes (e.g. ["es", "fr-FR"]) | | provider.name | AI provider: "openai", "anthropic", "gemini", or "grok" | | provider.model | Optional model override (uses provider default if omitted) | | provider.apiKeyEnv | Optional custom env variable name for the API key | | include | Glob patterns for source files to scan | | exclude | Glob patterns for files to skip | | output.format | "next-intl" (flat JSON) or "i18next" (namespaced JSON) | | output.path | Output directory for generated locale files |

CLI Commands

transia init

Initialize Transia in your project. Auto-detects framework (Next.js, Remix, Gatsby) and source directories.

transia translate

Extract strings and translate them.

| Flag | Description | |---|---| | --target <locales> | Override target locales (comma-separated) | | --provider <name> | Override AI provider | | --force | Re-translate all strings (ignore cache) | | --dry-run | Preview strings without calling the API | | --verbose | Enable debug logging |

transia status

Display translation coverage per locale.

transia reset --confirm

Delete translation state. Use --include-output to also delete generated locale files.

Inline Hints

Add context for the translator with comments:

{/* transia-context: This is a greeting shown on the dashboard */}
<h1>Welcome back!</h1>

Security

  • API keys are loaded from .env files and cleared from memory after each run.
  • Source code is sanitized before being sent to AI providers - secrets, tokens, and connection strings are automatically redacted.
  • All log output is scrubbed of API keys and tokens.
  • State files are written atomically with backup to prevent corruption.
  • Auth errors (401/403) abort immediately without retry to avoid key lockout.

License

MIT