@verbx/localize-next
v0.2.2
Published
VerbX Localize — Next.js App Router SDK: server-side getTranslations, SSR hydration seeding, locale middleware.
Readme
@verbx/localize-next
The Next.js App Router SDK for VerbX Localize — server-rendered
translations with no flash of English, plus everything in
@verbx/localize-react for client
components.
npm install @verbx/localize-nextServer components — translate before the HTML is sent
import { getTranslations } from "@verbx/localize-next";
export default async function Page() {
const t = await getTranslations({
apiKey: process.env.VERBX_API_KEY!,
projectKey: "proj_…",
locale: "es",
});
// Resolved on the server, so the user never sees English first.
return <h1>{t("Your cart")}</h1>;
}Client components
Wrap them in VerbXProvider (re-exported from the React SDK) and seed it with the translations you
already resolved on the server, so hydration does not re-fetch or flicker.
What you get
getTranslations(config)— an asynct()for server components and route handlers.resolveLocaleFromRequest(req)/LOCALE_COOKIE— locale from cookie, header, or path, for use in middleware.- Everything from
@verbx/localize-react—VerbXProvider,useT,<T>,useLocale.
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.
