Open in gallery
This sample is best viewed in the interactive gallery. Open now ยท Stay on this page

App settings web part

App settings web part

This sample shows how AppSettings.ts file can be added and used within SharePoint Framewrok webparts similar to the Web.config / App.config key value app settings in .NET Framework projects. That allows better DevOps and continuous integration (CI/CD) automation. The AppSettings.ts is transpiled/compiled with your SPFx solution which differs from the way the web.config. With .Net web.config file we would be able to update independently without the need of compiling DLLs. If that behavior is required, you can store your app settings in a SharePoint list and change them from there. However, that will have performance degradation over if the setting was part of the SPFx code where the logic can get a setting value in milliseconds.

Open this sample in the gallery (popup panel): Open in gallery

Source: https://github.com/pnp/sp-dev-fx-webparts/tree/main/samples/react-app-settings