SPFX - Best way to store custom settings file when developing extension app

907 Views Asked by At

I am developing SharePoint framework Extensions and need to store settings json file which can be configured anytime by admin/privilege person.(such as a component layout settings/app settings).

What is the best way to store such a settings file without storing database ?

for example - I could create json file when app is starting first time and retrieve the file data next time onwards.

is there any better solution ?

1

There are 1 best solutions below

1
On BEST ANSWER

I will make an assumption that it will be used in SharePoint.

If it was me, I would suggest using a SharePoint list to hold your settings as this provides an easy way for an admin to change your applications settings using the SharePoint UI rather than having to potentially download the JSON fike, edit and and then upload back into SharePoint.

Depending on how the settings need to be stored, are they global? Or scoped to a site collection? Will give you an idea of where the settings need to be stored.

If the settings are global then use a Tenant Property to configure where your app should load the settings from.

https://learn.microsoft.com/en-us/sharepoint/dev/spfx/tenant-properties

My thoughts.