In the Google Developers Console, one can read an API key for public access to their own API. When creating this API key you can specify what referrers are to be used with what keys.
I've looked around, and haven't found examples of how to pass this API key from a web client call in JavaScript nor have I been able to find how the API can check for the existence of this key and that it matches the referrer expectations as set in the Developer Console.
Does anyone have examples on this?
To talk to googles APIs you need an OAuth2 token. The scenario you're asking about (and more) is detailed here:
https://developers.google.com/identity/protocols/OAuth2
Edit: the specific client side use case is documented here https://developers.google.com/identity/protocols/OAuth2UserAgent