Hide secrets in plugin settings

Plugins that interact with online services usually need to store secrets like API keys or passwords. In web browsers, those fields are masked so a passerby can’t just see the password. (<input type="password">) That does not seem to be possible with the available types of settings for Obsidian plugins.

Is that correct?

If yes, could we get a way to do that? Either a new “secret” or “password” input element, or a method on TextComponent, to set a text input to hide its contents?

Thanks!

new Setting(containerEl).addText((text) => {
  text.inputEl.type = 'password';
});
1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.