As an example, check out how we place items in the world. Start with stonehearth_client.js, and look at the function_placeItemOrItemType. This function does a radiant.call, which calls stonehearth:choose_place_item_location.
Choose_place_item_location is defined as a function endpoint in manifest.json, and it’s implement in place_item_call_handler.lua. From place_item_call_handler.lua, we can get to something like town.lua, which has a self._sv inside of it that you can use to save things.
We do have C++ functions that will write to JSON directly but they’re buried explicitly under user_settings and building_template code, so that you can’t accidentally mess with them.