Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Define and read space level settings #446

Open
tomoglavas opened this issue Dec 19, 2024 · 0 comments
Open

Define and read space level settings #446

tomoglavas opened this issue Dec 19, 2024 · 0 comments

Comments

@tomoglavas
Copy link

Is your feature request related to a problem? Please describe.

I am building a plugin that needs to use external api, and needs an api key added for that. Currently, the only way I can see of doing that is to define it as a plugin option in the field-plugin.config.json file. That means that the api key will need to be added in plaintext, to each instance where it is defined in a block. The interface below is what I mean, for context.

Screenshot from 2024-12-19 14-08-31

If we need to change the api key to a new one at some point in time, that means going through all the block definitions and finding all the instances where this custom field plugin is used and manually updating the values. This is obviously error prone and less than ideal.

Describe the solution you'd like

After installing the plugin to a space, I can see there is a section in the space level settings for the plugin. See screenshot:

Screenshot from 2024-12-19 14-01-59

This implies I should be able to read these space level settings from within the plugin, but I don't see any examples of that, no mention in the documentation or in @storyblok/field-plugin code.

Ideally, we would be able to define required settings for the plugin to work, the interface type for each setting (ie, text/number/boolean/select options) and have the setting values automatically provided to the plugin instance at runtime.

Describe alternatives you've considered

Currently, settings are copied manually to each instance where plugin is added to a block.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant