To embed the DocEdior we need to call the DocEditor like this:
var docEditor = new DocsAPI.DocEditor("editor", config);
Where the config like config.editorConfig.user.name
. How do I read the config flags from within a plugin?
I tried setting the var config
as a global variable. I also tried to store the config in the sessionStorage. Neither the sessionStorage nor the global variables are available within the plugin as the editor loads in an iframe from a different domain/subdomain.
I saw that the plugin can read the content-controls, which are form fields, but I don’t want he user o fill in those fields. I want to know they were not modified by the user, and that’s why the config is validated via a JWT token.
- How can I read an editorConfig flag like config.editorConfig.user.name?
- How can I set a flag in the config, like editorConfig.plugins.myPlugin.serialKey, to be read and validate by my plugin?