Configure email shipping with Google Oauth2.0

I am new in Yii2. I need to know what libraries are needed and how I can configure mail shipping using the Google Oauth2.0 protocol. What should I put on the web.php or another configuration file? If it is possible for someone to show an example of configuration, it would be very grateful.