chrome-extension-google-apis icon indicating copy to clipboard operation
chrome-extension-google-apis copied to clipboard

Sample Google Chrome extension that demonstrates using the Chrome Identity API to authorize Google API access

GDE Sample: Chrome extension Google APIs

This is a sample Google Chrome extension that demonstrates using the Chrome Identity API to authorize access to the Gmail and Google+ APIs. It is a quick start to the Chrome User Authentication documentation.

Getting started

The quick and easy to get the code running on your computer.

  1. Download the source code.
  2. Load the extension in developer mode.
  3. Authorize extension.

Diving further

Getting the code working for your extension is a little more work since this sample comes preloaded with an existing Chrome extension id and Google APIs client details.

  1. Have a Chrome extension published with identity permission. It can be a private extension that does nothing.
  2. Install extension from the CWS and get the key. Adding this to your unpacked extension source makes the development ID match what the Google APIs app expects.
  3. Register Google APIs client and enable the Google APIs you plan on using.
  4. Set the API client details in the manifest.
  5. Authorize extension.

Notes

  • The URLs of the Google APIs you will be using must be whitelisted in the manifest.

Google product names and logos are owned by Google.