Getting Login Alerts for Security

I’m new to the Community Forum, so I’m not sure if this is the correct place to post this concern.

Is there any way to get an alert when a user logs into their account? This would allow someone to be notified of every login and be able to detect an intrusion instantly. For example, Google sends login alerts to Android phones for this purpose. I believe Facebook does this too. This seems pretty standard for protecting accounts that can be easily targeted, and as developers, we should at least have an API exposed for us to be alerted of every login/login attempt.

Thanks for reading this!