From 080d0d1565cb871a5a2f07f1124b9db5e082dc3d Mon Sep 17 00:00:00 2001 From: Andrea Martinelli Date: Thu, 15 Jan 2026 15:00:11 +0100 Subject: [PATCH 1/2] Init README for v5 of the TOS plugin --- README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.md b/README.md index 062a4e1..c71aa38 100644 --- a/README.md +++ b/README.md @@ -293,3 +293,13 @@ export default defineType({ ], }) ``` +# Migration from older versions to v5 +If you are migrating from version 4 or older to version 5 of the `sanity-plugin-tos`, please note the following. +For a better user experience, security issues and management of the TOS API key, we built a new configuration page that will automatically popup once you update to v5. +This new configuration page requires you to slightly change your TOS plugin configuration. Please follow the steps below: + +- Remove the `apiKey` and `env` options from your TOS plugin configuration in `sanity.config.ts` or `sanity.config.js`, both from the `tosPlugin` or the `translationOS` tool. +- Start your Sanity Studio, the TOS configuration page should popup automatically. +- Fill in the required fields (TOS API key, environment) and save the configuration. + +The configuration will be saved in your Sanity Studio dataset as a document of type `translationOSSettings`, and the plugin will use this configuration from now on. \ No newline at end of file From e7a750cb5744ea546592d018b1121f753b4c25a2 Mon Sep 17 00:00:00 2001 From: Andrea Martinelli Date: Thu, 22 Jan 2026 11:26:13 +0100 Subject: [PATCH 2/2] Updated README.md Missing images --- README.md | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index c71aa38..ac197d0 100644 --- a/README.md +++ b/README.md @@ -49,8 +49,6 @@ const fieldLevelTypes = ['blog'] // Common TranslationOS configuration const tosCommonConfig = { - apiKey: 'YOUR_TOS_API_KEY', - env: 'staging', supportedLanguages: languages, customBlockTypes: ['myblock'], } @@ -105,8 +103,6 @@ Returns a `ComponentViewBuilder` to be added to the _editor views_ for specific **Recommended**: only enable for schema types configured in your internationalization plugin. Options: -- `env` – TranslationOS API environment (`staging`, `sandbox` or `production`) -- `apiKey` – TranslationOS API key for the above environment - `supportedLanguages` – array of `{id, title}` language objects - `documentLocalizationSchemaTypes` – document types for document-level translation - `fieldLocalizationSchemaTypes` – document types for field-level translation @@ -126,6 +122,18 @@ Options: - `customBlockTypes` – additional block type names to treat like Sanity's `block` - `schemaTypes` – document types to manage with bulk translation +## Authentication +The plugin requires a TranslationOS API key to function. This API key will be stored securely in your Sanity dataset. +When you first use the plugin, you will be prompted to enter your API key and select the environment (`sandbox`, or `production`). + +### {{insert image}} + +## Reset authentication +Please note that the authentication configuration can be changed only be a Studio admin user. + +### {{insert image}} + + ## Known limitations For field translation mode: