Introducing The Sweep: OX’s New Live Security Research Series
Register Now
Breaking: The 2026 Vulnpocalypse Hits PHP: Four Critical RCEs, but How Dangerous Are They?
Read the Report
Are you exposed? Connect your apps in minutes.
Scan your apps free

@keytra/react

Latest version: v1.0.0

Overview

Last scanned
29 Nov 2026
Published
29 Nov 2026
npm package Publisher: slxca
0 Stars
0 Forks
1 Versions
TypeScript Repo language

Scan summary

@keytra/react was last scanned on 29 Nov 2026 at version 1.0.0. Risk score 0 of 100. No malicious behavior was detected.

  • Releases: First and only release on 29 Nov 2026.
  • Findings: No rules fired in version 1.0.0.

Versions

1 version published
Versions and the rules that fired in each
VersionPublishedStatus
1.0.0 LATEST 29 Nov 2026 No rules fired

No rules fired in 1.0.0

Findings

Findings for v1.0.0. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.

The score describes 1.0.0; other versions have their own rules, not their own score.

README

The publisher’s own README, as collected from the registry.

@keytra/react

Official React SDK, server translator and sync CLI for Keytra. Type-safe t(), no runtime dependencies in the React, server and config entry points, generated TypeScript key types.

License: MIT npm CI

Install

pnpm add @keytra/react
npm install @keytra/react
yarn add @keytra/react

React 18 or newer is an optional peer dependency (needed only for @keytra/react). The CLI needs Node.js 20 or newer.

Configuration (keytra.config.ts)

Run pnpm keytra init, or write it by hand:

import { defineConfig } from "@keytra/react/config";

export default defineConfig({
  url: "https://keytra.example.com",
  project: "my-project",
  sourceLocale: "en",
  // Empty: pull every target locale of the project.
  locales: [],
  namespaces: ["default"],
  paths: {
    source: "locales/{locale}.json",
    output: "locales/{locale}.json",
  },
  types: "src/keytra.d.ts",
});
Option Required Default Description
url Yes Base URL of your Keytra instance.
project Yes Project slug.
apiKey No KEYTRA_API_KEY Project API key (ktr_…). Prefer the env var; never commit the key.
sourceLocale No "en" Locale that push uploads.
locales No all target locales Locales that pull downloads.
namespaces No ["default"] Namespaces to push and pull.
paths.source Yes Source file pattern with {locale} and optional {namespace}.
paths.output No paths.source Output pattern for pulled locales.
format No "nested" "nested" or "flat" JSON.
fallback No "source" Value for missing translations: "source" or "empty".
indent No 2 JSON indentation in spaces.
prune No false push deletes server keys (and their translations) missing from the source files.
types No false Path of the generated .d.ts key types, or false to skip.

The CLI loads .env and .env.local next to the config file. Variables already set in the environment win. With several namespaces, use {namespace} in both paths, e.g. locales/{locale}/{namespace}.json.

CLI commands

Command Description Options
keytra init Create keytra.config.ts --force
keytra push Upload source keys --prune, --namespace <ns>, --dry-run
keytra pull Download translations and key types --locales <de,fr>, --no-types
keytra status Show progress per locale --fail-on-incomplete

Global options: --config <path> (default: keytra.config.{ts,mts,js,mjs}), -h, --help, -v, --version.

pnpm keytra push --dry-run
pnpm keytra push --namespace common --prune
pnpm keytra pull --locales de,fr --no-types
pnpm keytra status --fail-on-incomplete

--prune deletes server keys missing from the source files, including their translations. --fail-on-incomplete exits with code 1 if a locale has missing or outdated translations.

React usage (@keytra/react)

"use client";

import { useState } from "react";
import { KeytraProvider, useKeytra, useT } from "@keytra/react";
import en from "./locales/en.json";
import de from "./locales/de.json";

const messages = { en, de };

export function App() {
  const [locale, setLocale] = useState<"en" | "de">("de");
  return (
    <KeytraProvider
      locale={locale}
      messages={messages[locale]}
      fallbackMessages={en}
      onLocaleChange={(next) => setLocale(next as "en" | "de")}
    >
      <Greeting name="Ada" />
      <LocaleSwitch />
    </KeytraProvider>
  );
}

function Greeting({ name }: { name: string }) {
  const t = useT();
  const tHome = useT("home");
  return (
    <>
      <h1>{t("home.greeting", { name })}</h1>
      <p>{tHome("intro")}</p>
    </>
  );
}

function LocaleSwitch() {
  const { locale, setLocale, hasKey } = useKeytra();
  if (!hasKey("nav.switch")) return null;
  return <button onClick={() => setLocale(locale === "de" ? "en" : "de")}>{locale}</button>;
}
  • Placeholders: {name} or {{ name }}.
  • useT("home") scopes keys: t("intro") resolves home.intro.
  • useKeytra() returns { locale, setLocale, t, hasKey }. setLocale calls onLocaleChange; the parent owns the locale and loads its messages.
  • onMissingKey (provider prop) reports keys that are not found.

Server Components & Edge (@keytra/react/server)

import { createTranslator } from "@keytra/react/server";
import en from "@/locales/en.json";
import de from "@/locales/de.json";

export default function Page() {
  const t = createTranslator({ locale: "de", messages: de, fallbackMessages: en });
  return <h1>{t("home.title")}</h1>;
}

@keytra/react/server has no "use client" directive and no React dependency. It also works in Route Handlers, Edge runtimes, scripts and tests. Pass namespace: "home" to scope keys like useT("home").

Type-safe autocomplete

Set types in keytra.config.ts:

types: "src/keytra.d.ts",

pnpm keytra pull then writes a declaration file with every source key. It augments KeytraRegister in both @keytra/react and @keytra/react/server, so t("...") autocompletes and type-checks keys in client and server code. Make sure tsconfig.json includes the file (e.g. "include": ["src"]).

Without the CLI, bind typed hooks to your source messages:

import { createKeytra } from "@keytra/react";
import type en from "./locales/en.json";

export const { useT, useKeytra, createTranslator } = createKeytra<typeof en>();

Package exports

Export Contents
@keytra/react KeytraProvider, useT, useKeytra, createKeytra, plus everything from ./server (client bundle, "use client")
@keytra/react/server createTranslator and shared types (no React)
@keytra/react/config defineConfig and config types
bin: keytra CLI: init, push, pull, status

ESM and CommonJS builds are included for every entry point.


Keytra · keytra-action · Discussions · MIT License

OX Radar and Response Center

Find threats in your stack.

OX Radar can check high-priority threats, like critical package CVEs, against your context.

Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.

Where it’s listed

The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).

  • npm @keytra/react

References

The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.

Powered by Read the latest findings

Scan your whole stack

Group 1261154050 1
Group 1261154050
 

From OX Research Newsroom

Copy of Template Design OX Blog (1)
Research

Thousands Of GitHub Accounts Hijacked With wfx-loot CI Secret Stealing Malware Via GitHub Actions & npm

PolinRider Returns
Research

PolinRider Returns: Hijacked npm Packages Use Ethereum Blockchain to Conceal Malware Infrastructure

Cry2Wolf: How to Tell a Real Bug from a Nothingburger
AI & VibeSec

Cry2Wolf: Not Every Branded Bug Deserves a Fire Drill

Frame 2085668439 (1)
Group 1261154229