You can take a look at that nodebb-plugin-imgbed one, that's a pretty good example of saving settings too... /shameless plug