Skip to content

Commit 306d044

Browse files
committed
Update README.md
1 parent 82f4a9e commit 306d044

File tree

1 file changed

+25
-1
lines changed

1 file changed

+25
-1
lines changed

README.md

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ fields and additional request volumes see
2525

2626
[Click here to view the Java Spring SDK's API documentation](https://ipinfo.github.io/spring/).
2727

28-
⚠️ Note: This library does not currently support our newest free API https://ipinfo.io/lite. If you’d like to use IPinfo Lite, you can call the [endpoint directly](https://ipinfo.io/developers/lite-api) using your preferred HTTP client. Developers are also welcome to contribute support for Lite by submitting a pull request.
28+
The library also supports the Lite API, see the [Lite API section](#lite-api) for more info.
2929

3030
## Usage
3131

@@ -174,6 +174,30 @@ The `AttributeStrategy` allows the middleware to know where to store the
174174
Any exceptions such as `RateLimitedException` is passed through Spring's error
175175
handling system.
176176

177+
### Lite API
178+
179+
The library gives the possibility to use the [Lite API](https://ipinfo.io/developers/lite-api) too, authentication with your token is still required.
180+
181+
The returned details are slightly different from the Core API.
182+
183+
To use the Lite API you must use the `IPinfoLiteSpring`, it works in the same way as the `IPinfoSpring` class.
184+
185+
```java
186+
IPinfoLiteSpring ipinfoSpring = new IPinfoLiteSpring.Builder()
187+
// Set the IPinfo instance. By default we provide one, however you're
188+
// allowed to change this here. Also provide your IPinfo Access Token here.
189+
.setIPinfo(new IPinfoLite.Builder().setToken("IPINFO ACCESS TOKEN").build())
190+
// Set the InterceptorStrategy. By default we use
191+
// BotInterceptorStrategy.
192+
.interceptorStrategy(new BotInterceptorStrategy())
193+
// Set the IPStrategy. By default we use SimpleIPStrategy.
194+
.ipStrategy(new SimpleIPStrategy())
195+
// Set the AttributeStrategy. By default we use SessionAttributeStrategy.
196+
.attributeStrategy(new SessionAttributeStrategy())
197+
// Finally build it.
198+
.build();
199+
```
200+
177201
### Other Libraries
178202

179203
There are [official IPinfo client libraries](https://ipinfo.io/developers/libraries) available for many languages including PHP, Python, Go, Java, Ruby, and many popular frameworks such as Django, Rails, and Laravel. There are also many third-party libraries and integrations available for our API.

0 commit comments

Comments
 (0)