Is there any way to run JavaScript code when an SPFX app is installing. To be specific - I would like to change the permissions for the lists that are being deployed by the same app. If there is no out of the box way to do this, what is the preferred go-to method of running a piece of code once when the app is being added to a site.

1 Answer 1


Unfortunately, that's not possible. The way around it would be to have the code run when the SPFx app (web part/extension) executes and check if it needs to run the setup code or if it can skip it because everything's already in place.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.