I’ve developed a custom Magento 2 extension that includes an automatic version check mechanism.
Here’s what it currently does:
- Uses an observer (
controller_action_predispatch) to check an external endpoint for the latest version (info.json). - Implements 24-hour cache to avoid repeated API calls.
- Compares the latest version with the current one using
version_compare(). - Sends admin notifications if a new version is available.
At the moment, it only notifies administrators about updates — it doesn’t automatically install them.
This approach is designed to maintain stability and security, since direct auto-updates could disrupt deployments.
My questions:
Is fully automatic module updating (code replacement + setup upgrade) officially supported in Magento 2?
If not, what is the safest or officially recommended alternative?
Are there best-practice examples for extensions that update via API instead of Composer?
Thank you!