Note: This release is in preview. Features described here don’t become generally available until the latest general availability date that Salesforce announces for this release. Before then, and where features are noted as beta, pilot, or developer preview, we can’t guarantee general availability within any particular time frame or at all. Make your purchase decisions only on the basis of generally available products and features.
Customize Second-Generation Managed Package Installs and Uninstalls Using Scripts
For more information, see Run Apex on Package Install/Upgrade and Run Apex on Package Uninstall.
You can also use the --post-install-script and the --uninstall-script Salesforce CLI parameters with the sf package version create command. The CLI parameters override the scripts specified in the sfdx-project.json file.
You can designate an active Dev Hub org user to receive email notifications for Apex gacks, and install, upgrade, or uninstall failures associated with your packages. In Salesforce CLI run sf package create --error-notification-username me@devhub.org or sf package update --error-notification-username me@devhub.org. In Tooling API, use the PackageErrorUsername field on the Package2 object.