Skip to content

Commit 7fcba6b

Browse files
committed
document the GOOGLE_API_KEY env var
1 parent ea1927f commit 7fcba6b

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

docs/api/environment-variables.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,32 @@ Windows console example:
1919
> electron
2020
```
2121

22+
## Production Variables
23+
24+
The following environment variables are intended primarily for use at runtime
25+
in packaged Electron applications.
26+
27+
### `GOOGLE_API_KEY`
28+
29+
Electron includes a hardcoded API key for making requests to Google's geocoding
30+
webservice. Because this API key is included in every version of Electron, it
31+
often exceeds its usage quota. To work around this, you can supply your own
32+
Google API key in the environment. Place the following code in your main process
33+
file, before opening any browser windows that will make geocoding requests:
34+
35+
```javascript
36+
process.env.GOOGLE_API_KEY='YOUR_KEY_HERE'
37+
```
38+
39+
By default, a newly generated Google API key may not be allowed to make
40+
geocoding requests. To enable geocoding requests, visit this page:
41+
https://console.developers.google.com/apis/api/geolocation/overview
42+
43+
## Development Variables
44+
45+
The following environment variables are intended primarily for development and
46+
debugging purposes.
47+
2248
### `ELECTRON_RUN_AS_NODE`
2349

2450
Starts the process as a normal Node.js process.

0 commit comments

Comments
 (0)