bunkerweb / bunker

Secure student environment
2 stars 3 forks source link

SDK Config management #8

Open proudparrot2 opened 2 months ago

proudparrot2 commented 2 months ago

SDK Config will allow for plugins to set and manage configuration for their plugin. Configuration will be persisted in either Local Storage or IndexedDB. Configuration options can be exposed to the users for them to set, see here

Since the SDK is scoped per plugin, they can use generic keys without interrupting the configs of other plugins.

tile(sdk) {
    sdk.config.set("hello", "world")
    sdk.config.get("hello") // world

    // user changes a setting linked to "hello"
    sdk.config.get("hello") // hey
}
Cattn commented 2 months ago

I think IndexedDB is perfect for this, works perfect with key pair based system for config, as long as it's not being used here to call functions.

For that we might want to use postMessage something else?