Try fetch method.
Note when a request is made using the client ID, google will only allow entry if the request was made from a URL that you have authorized in “Authorized JavaScript origins”.
For example if you only authorize requests from www.YourWebsite.com then someone else making a request with your client ID from www.TheirWebsite.com would not gain entry.