@verbx/localize-electron
v0.2.2
Published
VerbX Localize — Electron SDK: API key stays in the main process, renderer translates over a narrow IPC bridge.
Readme
@verbx/localize-electron
The Electron SDK for VerbX Localize. Your vx_ API key stays in
the main process and never reaches the renderer — the renderer translates over a narrow IPC
bridge.
npm install @verbx/localize-electronThree files, one per process, because that is the shape of the security decision.
// main.js — holds the API key, owns the cache, is the only process that reaches the network
import { app, ipcMain } from "electron";
import { createVerbXMain, FileStore } from "@verbx/localize-electron";
const verbx = createVerbXMain({
apiKey: "vx_…",
projectKey: "proj_…",
ipcMain,
storage: new FileStore({ directory: app.getPath("userData") }),
});
await verbx.restore();
app.on("before-quit", () => void verbx.flush());// preload.js — exposes exactly one function, nothing else
import { contextBridge, ipcRenderer } from "electron";
import { exposeVerbX } from "@verbx/localize-electron";
exposeVerbX(contextBridge, ipcRenderer);// renderer — the ordinary React (or Vue) SDK, with IPC as the transport
import { VerbXProvider } from "@verbx/localize-react";
import { IpcTranslationService } from "@verbx/localize-electron";
<VerbXProvider
config={{ apiKey: "unused", projectKey: "proj_…", service: new IpcTranslationService() }}
>
<App />
</VerbXProvider>;Why the split
On the web the vx_ key ships in the bundle because there is nowhere else to put it. Electron has
a Node process the renderer cannot read, so shipping the key into the renderer would adopt the
web's compromise without the web's excuse. The key never leaves main.
Everything else — batching, dedupe, cache tiers, discovery filtering, interpolation — is the same
runtime running in the renderer, because TranslationService is a frozen interface and the engine
does not care what is behind it.
Docs
Full guide, the CLI, and the GitHub agent: localize.verbxeco.com — the Docs section is readable without an account.
License
Proprietary. See LICENSE.md and the VerbX terms of service.
