diff --git a/README.md b/README.md index 465982d..70e66db 100644 --- a/README.md +++ b/README.md @@ -12,3 +12,11 @@ The code is in `remix` folder. ## Custom RTE field The code is in `rte` folder. + +### Configuration + +The RTE plugin has the following configuration available. The values should be set on App Config level and overriden when needed on Plugin Config level. + +- `baseUrl`: The base url for Contentstack, most likely `https://eu-app.contentstack.com/` +- `formatId`: The id for the format in ImageVault to use when selecting an asset in ImageVault +- `imageVaultUrl`: The URL to the ImageVault instance to use when selecting an asset. diff --git a/rte/main.tsx b/rte/main.tsx index a1f5169..6fac35a 100644 --- a/rte/main.tsx +++ b/rte/main.tsx @@ -181,7 +181,17 @@ async function init() { const savedSelection = rte?.selection?.get() ?? undefined; // @ts-expect-error: Added at runtime - const config = await rte.getConfig(); + const appConfig = await rte.getConfig(); + + // This is the configuration for this instance of the plugin. + // You edit this in the content types settings RTE plugin section. + // @ts-expect-error: Added at runtime + const pluginConfig = await rte.getFieldConfig(); + + const config = { + ...appConfig, + ...pluginConfig, + }; openImageVault({ config,