Tutorials · for developers
Translate your app with Sonenta
A scenario-based walkthrough. Every tutorial has two parts: Integration & init (get Sonenta wired into your repo) and a work sequence (the AI prompts and reviews that get the job done). The commands and prompts are exact, copy them straight in.
v1 covers Translation. More scenarios (accessibility, evaluation, delivery) land after this format is validated.
Translation
Wire Sonenta into your repo, then run the generate, review, publish loop with your local AI.
Integration & init
-
Install the CLI
shellnpm install -g @sonenta/cli # provides the `sonenta` command
-
Authenticate
Create an API key in the dashboard (Settings → API keys) with the
mcp:*scope so the local-AI agents can act.shellsonenta login --token vrb_live_<prefix>.<secret> # --host defaults to https://api.sonenta.dev
-
Initialize the project
Run in your repo root. This scaffolds
sonenta.config.json, a managed block inCLAUDE.md/AGENTS.mdso your local AI knows the project, and auto-wires the MCP server into.mcp.json(secret-free, the server reads credentials from yoursonenta login).shellsonenta init --project <PROJECT_UUID>
sonenta.config.json{ "host": "https://api.sonenta.dev", "project_uuid": "<PROJECT_UUID>", "version_slug": "main" }.mcp.json{ "mcpServers": { "sonenta": { "command": "npx", "args": ["-y", "@sonenta/mcp"], "env": { "SONENTA_BASE_URL": "https://api.sonenta.dev", "SONENTA_PROJECT": "<PROJECT_UUID>" } } } } -
Install the local-AI agent
Writes
.claude/agents/sonenta-i18n.mdand ensures.mcp.jsonis wired.sonenta agents listshows all bundled agents, e.g.sonenta-a11y.shellsonenta agents add sonenta-i18n # the translation agent
-
Verify the setup
shellsonenta doctor # checks MCP wired, reachable, scoped
-
Add the runtime SDK
Wrap your app once with the provider, then render strings with the
t()hook as usual. Published translations arrive over the CDN with no code change.shellnpm install @sonenta/react-i18next
app entryimport { SonentaProvider } from "@sonenta/react-i18next"; <SonentaProvider apiBase="https://api.sonenta.dev" projectUuid="<PROJECT_UUID>" token="vrb_live_<prefix>.<secret>" // a key with the missing:write scope defaultLocale="en" namespaces={["common"]} > <App /> </SonentaProvider>any componentconst { t } = useTranslation(); return <button>{t("checkout.pay")}</button>; -
Or set it all up in one prompt
Hand the whole setup to your local AI:
Prompt your AI Set up Sonenta in this repo: run sonenta login with my API key, then sonenta init --project <PROJECT_UUID> (wire the MCP server and write the CLAUDE.md block), install the sonenta-i18n agent, run sonenta doctor, and add the @sonenta/react-i18next SDK with a SonentaProvider around my app.
The translation workflow
A simple three-step loop: generate drafts, review, publish.
-
1. Generate translations (drafts)
The agent runs locally (0 AI credits):
coverage_report→list_untranslated_keys→propose_translations_bulk, honoring your glossary and project context. The result is draft translations in Sonenta, nothing is live yet.Prompt your AI Using sonenta-i18n, translate my untranslated keys into French and Spanish, then submit them for my review.
-
2. Review in Sonenta
Open the Translations editor in the dashboard (
/translations). Approve or edit each draft. Only what you approve becomes publishable. -
3. Publish to the CDN
The agent calls
publish_cdn. Published translations are served from the CDN and picked up automatically by your app through@sonenta/react-i18next, no code change, no redeploy.Prompt your AI Publish the approved translations to the CDN.
Publishing happens through the agent’s publish_cdn tool (or the prompt above). There is no separate sonenta publish command, the CLI’s push / pull sync local locale files, not the AI-driven flow above.