Documentation

Java

Add cloud.retracekit:sdk, call RetraceKit.init, and exceptions become events. Requires Java 17+. Runtime dependency: kotlin-stdlib.

Install

Gradle (Kotlin DSL):

dependencies {
    implementation("cloud.retracekit:sdk:0.1.1")
}

Maven:

<dependency>
  <groupId>cloud.retracekit</groupId>
  <artifactId>sdk</artifactId>
  <version>0.1.1</version>
</dependency>

Coordinates: cloud.retracekit:sdk. Source: sdk-java. Announcement: Java error tracking.

Initialize

import com.retracekit.sdk.Config;
import com.retracekit.sdk.RetraceKit;

RetraceKit.init(
    Config.builder()
        .apiKey(System.getenv("RETRACE_KIT_API_KEY"))
        .build()
);

apiKey is enough. Optional release should come from the JAR Implementation-Version — see SDK → Release.

Option Default Notes
apiKey - Required. Blank key disables sending and logs a warning.
environment - Attached to every event (for example production).
enabled true Set false to keep hooks quiet locally.

Auto-capture

After init, the SDK wraps Thread.setDefaultUncaughtExceptionHandler and still invokes any handler that was already installed. Events include userAgent like Java 21.0.2 and tag runtime:java.

Identical crashes inside a 30-second window are deduplicated client-side. init also sends a session ping. Handled errors: capture via captureException.

Kotlin

import com.retracekit.sdk.Config
import com.retracekit.sdk.RetraceKit

RetraceKit.init(
    Config(
        apiKey = System.getenv("RETRACE_KIT_API_KEY")!!,
    ),
)

Same artifact as Java. RetraceKit methods are @JvmStatic. There is no Spring or servlet extra in this package.

Manual capture

import com.retracekit.sdk.BreadcrumbType
import com.retracekit.sdk.RetraceKit

RetraceKit.setUser("user_123")
RetraceKit.setTag("plan", "pro")
RetraceKit.addBreadcrumb(
    type = BreadcrumbType.COMMON,
    name = "checkout",
    value = "started",
)

try {
    checkout()
} catch (error: Throwable) {
    RetraceKit.captureException(error, mapOf("url" to request.requestURI))
}

Pass url on captureException so the issue page has a route. There is no servlet filter in this package.

See also breadcrumbs, current user, incidents.

Notes

  • Java 17+ — Kotlin source, Java 17 bytecode.
  • kotlin-stdlib — only runtime dependency.
  • Request URL — pass url to captureException.

Examples live in the sdk-java repo (examples/).