Branching
Tolgee supports project branching, allowing you to work on translations in isolated branches — similar to how Git branches work for code. The SDK lets you scope your app to a specific branch, so both translation fetching and in-context editing operate against that branch.
Branching is available on Advanced and Enterprise plans. See Branching overview for setup instructions and full details.
Setting the branch
Pass the branch option when initializing Tolgee:
const tolgee = Tolgee()
.use(DevTools())
.use(FormatSimple())
.init({
apiUrl: 'https://app.tolgee.io',
apiKey: 'your-api-key',
branch: 'my-feature',
});
When branch is set:
- Translation fetching pulls translations from that branch instead of the default one.
- In-context editor creates and updates keys on that branch.
- "Open in platform" links point to the correct branch in the Tolgee web app.
If branch is omitted, the SDK uses the project's default branch (backward-compatible with projects that don't use branching).
Protected branches
Branches can be marked as protected in the Tolgee platform. When working with a protected branch:
- The in-context editor opens in read-only mode if your API key doesn't have the
branch.protected-modifyscope. - If you attempt to save a translation, the editor switches to read-only automatically and shows a notification.
To edit translations on a protected branch, use an API key with the branch.protected-modify scope.