Configuration file for SPFx Extension – Best practice

Copper Contributor


I am creating a SPFX extension to access lists and display the list data. I would like to have a configurable settings file where I can store to list name for different environment like dev, test and production and then access the value from the configuration file.

Is there a best practice for creating such configurations with regards to SPFx extensions/web parts?




1 Reply
For web parts, you can have configurable web part properties and using PnP property controls, you can allow the users to choose the list or you can even provision the list while adding the app to the site.
For extension, its different, the properties are stored in the app catalog, if you still want to use different configs for different environment, I suggest you maintain a list and make sure the list exists in all the environment. But for the tenant-wide extensions, you have to maintain the configs as a properties which will be stored in the app catalog site.