Skip to content

Commit 83ad0fd

Browse files
committed
Fix JavaScript examples
1 parent a31546d commit 83ad0fd

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

content/geoip/geolocate-an-ip/web-services.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,10 +102,17 @@ WebServiceClient client = new WebServiceClient.Builder(10, "LICENSEKEY").host("g
102102
```
103103

104104
```javascript
105-
const client = new WebServiceClient('10', 'LICENSEKEY');
105+
const WebServiceClient = require('@maxmind/geoip2-node').WebServiceClient;
106+
// TypeScript:
107+
// import { WebServiceClient } from '@maxmind/geoip2-node';
108+
109+
const accountId = '10';
110+
const licenseKey = 'LICENSEKEY';
111+
112+
const client = new WebServiceClient(accountId, licenseKey);
106113

107114
// To query the GeoLite web service, you must set the optional `host` parameter
108-
const client = new WebServiceClient('10', 'LICENSEKEY', {
115+
const client = new WebServiceClient(accountId, licenseKey, {
109116
host: 'geolite.info',
110117
});
111118
```

0 commit comments

Comments
 (0)