SDKs
Java & Kotlin SDK
The official Wayline SDK for Java & Kotlin: Java 11+ (java.net.http.HttpClient). Works from Kotlin. One small dependency for JSON (Jackson).
Install
<dependency>
<groupId>com.wayline</groupId>
<artifactId>wayline-java</artifactId>
<version>0.1.0</version>
</dependency>
<!-- Gradle: implementation("com.wayline:wayline-java:0.1.0") -->Quickstart
Set WAYLINE_API_KEY to a test key (see the Quickstart), then:
import com.wayline.WaylineClient;
import com.wayline.model.*;
WaylineClient wayline = WaylineClient.builder()
.apiKey(System.getenv("WAYLINE_API_KEY"))
.build();
DistanceResponse d = wayline.distance(DistanceRequest.of("23.7925,90.4078", "23.733,90.4172").units("imperial"));
System.out.println(d.distanceMiles() + " mi, " + d.durationSeconds() + " s");Errors
Non-2xx responses raise a typed error after retries are exhausted. Branch on code — the full list is in the error reference.
try {
wayline.distance(DistanceRequest.of("0,0", "0,1"));
} catch (WaylineException e) {
System.out.println(e.code() + " " + e.status() + " " + e.requestId());
}Configuration
| Option | Default | Description |
|---|---|---|
| API key | WAYLINE_API_KEY | Your live or test key. Never logged. |
| Base URL | https://api.wayline.cloud | Override for staging or a proxy. |
| Timeout | 30 seconds | Per attempt. |
| Max retries | 3 | For 429 and 5xx, with exponential backoff + jitter, honoring Retry-After. |
Source and releases
Package: com.wayline:wayline-java on Maven Central. Source: packages/sdk-java. Versions follow semantic versioning; see the CHANGELOG in the package and our product changelog.