What goes where the plugin settings?


I have been reading this page about plugin settings. It seems like a great document except that it does not tell what goes to which file. I am not a js/ts developer so it is a bit hard for me to figure out what it going on. I understand the code but I do not understand which part of code should be part of what.

I am looking for advice on the file naming and where they belong to. It seems to me that the doc is implying about multiple files but I can’t really decipher the names. I already have a working main.ts plugin, I just need to add couple text line options in the settings


In the sample code on the page, you can see that typing into the textbox triggers the plugin’s saveData method. This method saves its argument to data.json under the plugin folder (.obsidian/plugins/<plugin-id>/data.json), as stated in the docs.

In most cases, all of your plugin settings should go to data.json, so you don’t have to manually set another export file by yourself.

By the way, I recommend looking at the sample plugin if you haven’t.