Skip to main content

NiteaClient

package cc.nitea;

public final class NiteaClient

Capture and report methods return the event's UUID, or null when nothing was sent.

Errors​

captureException(Throwable throwable)​

UUID

Reports a caught exception at level ERROR.

captureException(Throwable throwable, Level level)​

UUID

Reports a caught exception with the given level.

captureException(Throwable throwable, Level level, Map<String, String> extraTags)​

UUID

Reports a caught exception with extra tags for this event only.

captureMessage(String message, Level level)​

UUID

Reports something that isn't an exception, like a failed sanity check.

Player feedback​

These need the player to have allowed reports; they're never held back. See Player reports.

reportBug(String description)​

UUID

Sends a bug report written by the player.

UUID

Sends a bug report. onCompletionLink receives the one-time link to complete it, when your project has a public page. Runs on Nitea's background thread.

reportSuggestion(String suggestion)​

UUID

Sends a suggestion written by the player.

UUID

Sends a suggestion, with a callback for the completion link.

Context​

addBreadcrumb(String category, String message)​

void

Records something your mod did, at level INFO. Attached to the next event.

addBreadcrumb(String category, String message, Level level)​

void

Records a breadcrumb with the given level.

setTag(String key, String value)​

void

Sets a tag sent with every following event. null removes it.

State​

isEnabled()​

boolean

true when events are being sent: an SDK key is set, the key was accepted and the player allowed reports.

modId()​

String

The mod ID this client reports for.

installationId()​

String

The anonymous random ID of this game installation, shared by every mod using Nitea. null unless the player allowed reports.

Lifecycle​

close(Duration timeout)​

void

Sends what's still queued, waiting up to timeout, and stops. Called automatically on JVM exit; you don't need to call it.