How to use the Alert API