Skip to main content

Java SDK

kloakd-sdk for Java 21+

1 min read


Install

<dependency>
  <groupId>dev.kloakd</groupId>
  <artifactId>kloakd-sdk</artifactId>
  <version>0.1.0</version>
</dependency>

Java 21+ | 67/67 tests | 88.7% line | 70.7% branch | 96.2% method | stdlib HttpClient

Client

Kloakd client = Kloakd.builder()
    .apiKey(System.getenv("KLOAKD_API_KEY"))
    .organizationId(System.getenv("KLOAKD_ORG_ID"))
    .timeout(Duration.ofSeconds(30))
    .maxRetries(3)
    .build();

Async (CompletableFuture)

client.evadr().fetchAsync("https://example.com")
    .thenAccept(r -> System.out.println(r.artifactId()));

SSE streaming (Stream)

try (var stream = client.evadr().fetchStream("https://example.com")) {
    stream.forEach(e -> System.out.println(e.type()));
}
Was this page helpful?