Installing webpart to SharePoint Online via sppkg, how to programmatically change configuration parameters at install time?
If we have a webpart that needs particular configuration parameters that will change with each installation (e.g. the AAD/Entra tenant-id), and we need to be able to automatically configure a webpart added to a Sharepoint tenancy via the App Catalog, how can we programmatically set these configuration parameters so that each time the webpart is added to a page it has the right values?
The only thing I can think of that would work is to unpack the sppkg, update the files containing the configuration values (there are a few), and repackage again, but that's pretty ugly and from experience can cause odd errors. I suppose in principle it's possible for the web part to somehow go off and fetch those configuration values from somewhere in SP itself where the installer puts them? But what if it had been added to teams etc.?