new GoodchargeStation(options)
| Option | Default | Meaning |
|---|---|---|
apiKey | required | The station's key. Throws invalid_api_key if malformed. |
baseUrl | https://api.goodcharge.app | API origin. |
timeoutMs | 10000 | Per attempt. Must be a positive integer. |
maxRetries | 3 | Retries after 429, 5xx, a timeout or a network error. Must be a non-negative integer. |
fetch | global fetch | Custom fetch implementation. |
metricsLabel | key prefix (gc_XXXXXXXX) | The station label in metrics. 1 to 64 characters, no control characters. See Monitoring with Prometheus. |
A non-integer or out-of-range timeoutMs or maxRetries, or an invalid metricsLabel, throws invalid_option synchronously, from the constructor, before any request is made.