API Keys
Some features of Chromium use Google APIs, and to access those APIs, either an API Key or a set of OAuth 2.0 tokens is required.
These instructions apply to Chromium version 23 and higher.
You can specify the API keys to use either when you build Chromium, or at runtime using environment variables. First, you need to acquire keys for yourself.
The keys you acquire are not for distribution purposes and must not be shared with other users.
Acquiring Keys
Providing Keys at Build TimeIf you are building Chromium yourself, you can provide keys as part of your build configuration, that way they are always baked into your binary. To do this, specify a few variables to gyp (there are three ways to do this; see the Setup section on this page ). One easy way is to create, or edit, the file ~/.gyp/include.gypi (or C:\Users\yourusername\.gyp\include.gypi if you’re on Windows), with contents like the following:{ 'variables': { 'google_api_key': 'your_api_key ', 'google_default_client_id': 'your_client_id', 'google_default_client_secret': 'your_client_secret ', # … other variables you may have ... }, } where the text “(your API_KEY)” is replaced with your API_KEY value, and so forth. Once you’ve done this, run gclient sync or gclient runhooks, and your builds after that will use your keys.
Note that the above is equivalent to providing more flags gyp, i.e. build/gyp_chromium -Dgoogle_api_key='...' -Dgoogle_default_client_id='...' -Dgoogle_default_client_secret='...' .
Providing Keys at RuntimeIf you prefer, you can build a Chromium binary (or use a pre-built Chromium binary) without API keys baked in, and instead provide them at runtime. To do so, set the environment variables GOOGLE_API_KEY, GOOGLE_DEFAULT_CLIENT_ID and GOOGLE_DEFAULT_CLIENT_SECRET to your " API key", "Client ID" and "C lient secr et" values respectively.Getting Keys for Your Chromium Derivative
Many of the Google APIs used by Chromium code are specific to Google Chrome and not intended for use in derived products. In the API Console (http://developers.google.com/console) you may be able to purchase additional quota for some of the APIs listed above. For APIs that do not have a "Pricing" link, additional quota is not available for purchase.
|