Scan your whole stack
From OX Research Newsroom
Are you using @keytra/react?
Find out what’s in your code.
Scan your apps free in minutes (opens in a new tab)Latest version: v1.0.0
@keytra/react was last scanned on 29 Nov 2026 at version 1.0.0. Risk score 0 of 100. No malicious behavior was detected.
| Version | Published | Status |
|---|---|---|
| 1.0.0 LATEST | 29 Nov 2026 | No rules fired |
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.
The publisher’s own README, as collected from the registry.
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.
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.
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.
| 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.
@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>;
}
{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.@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").
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>();
| 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
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.
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).
The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.