Skip to content

Commit 22b4273

Browse files
author
Usman Liaqat
committed
Documentation updated according to the updated SDK
1 parent e753084 commit 22b4273

File tree

1 file changed

+36
-1
lines changed

1 file changed

+36
-1
lines changed

README.md

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ You need a valid 'IPGeolocation API key' to use this SDK. [Sign up](https://ipge
2626

2727
Internet connection is required to run this component.
2828

29+
## Documentation
30+
Use the following URL to visit documentation
31+
[https://ipgeolocation.io/documentation.html](https://ipgeolocation.io/documentation.html)
32+
2933
## Installation
3034
### CDN Link
3135

@@ -77,6 +81,12 @@ _ipgeolocation.setFields("geo,time_zone,currency");
7781
_ipgeolocation.setIPAddress("1.1.1.1");
7882
_ipgeolocation.setExcludes("ip");
7983
_ipgeolocation.getGeolocation(handleResponse, "YOUR_API_KEY");
84+
85+
// Get geolocation along with hostname, security detail and user-agent detail.
86+
_ipgeolocation.includeHostname(true);
87+
_ipgeolocation.includeSecurity(true);
88+
_ipgeolocation.includeUserAgent(true);
89+
_ipgeolocation.getGeolocation(handleResponse, "YOUR_API_KEY");
8090
```
8191
## Time Zone API
8292

@@ -113,6 +123,31 @@ _ipgeolocation.getTimezone(handleResponse, "YOUR_API_KEY");
113123
// Get time zone information by coordinates of the location
114124
_ipgeolocation.setCoordinates("31.4816", "74.3551");
115125
_ipgeolocation.getTimezone(handleResponse, "YOUR_API_KEY");
126+
127+
// Get time zone information by location
128+
_ipgeolocation.setLocation("Amman, Jordan");
129+
_ipgeolocation.getTimezone(handleResponse, "YOUR_API_KEY");
130+
```
131+
132+
## Time Zone API
133+
134+
Here are a few examples to query Time Zone information from Timezone API.
135+
136+
```javascript
137+
// Function to handle the response from IP Geolocation API.
138+
// "response" is a JSON object returned from IP Geolocation API.
139+
function handleResponse(response) {
140+
console.log(response);
141+
}
142+
143+
// Toggle sessionStorage usage to store API response on client-side. (This is very handy as it will help users to avoid making duplicate API calls for a single visitor.)
144+
_ipgeolocation.enableSessionStorage(true);
145+
146+
// Toggle API calls' async behavior. By default, async is true.
147+
_ipgeolocation.makeAsyncCallsToAPI(false);
148+
149+
// Get User Agent detail.
150+
_ipgeolocation.getUserAgent(handleResponse, "YOUR_API_KEY");
116151
```
117152

118153
## Example
@@ -159,4 +194,4 @@ Here is a sample code to use IP Geolocation API using JQuery SDK:
159194
* Czech (cs)
160195
* Italian (it)
161196

162-
By default, geolocation information is returned in English. Response in a language other than English is available to paid users only.
197+
By default, geolocation information is returned into English. Response in a language other than English is available to paid users only.

0 commit comments

Comments
 (0)