Skip to main content
ctx.config (PluginConfigStore) is a persistent key-value store namespaced to your plugin. All methods are async, and values survive shell restarts.
const interval = await ctx.config.get<number>("refresh_interval", 30);
const links = await ctx.config.get<object[]>("quick_links", []);

await ctx.config.set("last_sync", Date.now());
await ctx.config.delete("stale_key");

const all = await ctx.config.getAll();
Note: config.get() is async in the background context. In the UI context (via usePluginContext()), it’s synchronous. When to use it: store small amounts of plugin state that must outlive a restart — sync cursors, cached metadata, user-set preferences. For larger or relational data, reach for ctx.database instead.