Revclust
DocsBlogPricing
Log inStart free
DocsBlogPricingLog inStart free

Start Here

  • Overview
  • Access and Setup
  • Getting Started

Integration

  • Integrate the SDK
  • Trigger Your First Incident

Verification

  • Verify and Observe

Viewer

  • Viewer Workflow

Help

  • Troubleshooting

Reference

  • SDK Reference

Documentation

SDK Reference

Look up the main SDK types, methods, outcomes, and status values.

Canonical Import

Use this SDK entrypoint:

import "package:revclust_flutter/revclust_flutter.dart";

This reference covers the SDK exported by revclust_flutter.dart.

Initialization

The SDK client is app-scoped. Start it once with Revclust.initialize(...) and keep the returned client for the rest of the process.

final Revclust revclust = await Revclust.initialize(
  RevclustConfig(
    projectKey: "rpk_...",
  ),
);

Optional release/build metadata can be added once the first capture works:

final Revclust revclust = await Revclust.initialize(
  RevclustConfig(
    projectKey: "rpk_...",
    releaseStage: RevclustAppReleaseStage.production,
    appVersion: "1.4.2",
    build: "14207",
    gitSha: "49948bf",
  ),
);
TypePurpose
RevclustApp-scoped SDK client.
RevclustConfigStartup config containing projectKey and optional release/build metadata.
RevclustAppReleaseStageApp release metadata: development, staging, production, test, or a validated custom value.

appVersion, build, and gitSha are release metadata attached to captured incidents. They do not affect SDK connectivity or SDK key availability.

Core Methods

These are the main methods exposed on Revclust:

MemberPurpose
statusCurrent SDK state.
uploadSnapshotCurrent best-known queue and upload state.
diagnosticsPrivacy-safe snapshot of bootstrap state, origin, last status, and safe error details.
uploadEventsBroadcast stream of later upload lifecycle events.
captureInvariantFailure(failure)Capture one app-owned factual invariant failure.
enableDioCapture(dio)Registers a Dio client for bounded request outcomes and best-effort normalized paths. App-selected route templates replace inferred paths.
setStateSnapshotProvider(provider)Registers the bounded state payload attached to later captures.
recordUiIntent(...)Records one UI intent event for the current evidence buffer.
recordScreenTransition(...)Records one screen transition event for the current evidence buffer.

State Snapshot Provider

setStateSnapshotProvider(...) accepts a synchronous RevclustStateSnapshotProvider. The provider returns a RevclustStateSnapshot with two small maps: appState and dataState.

revclust.setStateSnapshotProvider(() {
  return const RevclustStateSnapshot(
    appState: <String, Object?>{
      "screen": "checkout",
      "step": "payment",
    },
    dataState: <String, Object?>{
      "orderRef": "ord_ref_7d82b1",
      "currency": "GBP",
    },
  );
});

Invariant Failure Model

App-owned captures use one RevclustInvariantFailure. It describes the failure class, the specific subject involved, what was expected, and what was observed.

New captures use failureKind, subject, expected, and observed rather than authored incident prose.

TypePurpose
RevclustInvariantFailure.failureKindStable failure class, title, and grouping key.
RevclustInvariantFailure.subjectPrivacy-safe entity or flow involved in the failure, represented by RevclustSubject(kind, value).
RevclustInvariantFailure.expectedRequired non-empty factual invariant object.
RevclustInvariantFailure.observedRequired non-empty factual observed object.
final RevclustInvariantFailure failure = RevclustInvariantFailure(
  failureKind: "checkout_confirmation_mismatch",
  subject: RevclustSubject(kind: "order_ref", value: "ord_ref_7d82b1"),
  expected: <String, Object?>{
    "order_status": "confirmed",
  },
  observed: <String, Object?>{
    "order_status": "retrying",
    "last_action": "submit_order",
  },
);

Immediate Capture Outcomes

captureInvariantFailure(...) returns a RevclustCaptureOutcome immediately. That outcome is separate from later upload events.

OutcomeMeaning
RevclustCaptureQueuedCapture was built and stored for upload handling. Includes captureId.
RevclustCaptureBlockedCapture was blocked before a real capture existed. Includes status and optional message.
RevclustCaptureBuildFailedCapture reached build but failed before queueing. Includes captureId and optional message.
RevclustCapturePersistenceFailedCapture built but could not be stored in the local queue. Includes captureId and optional message.

Status

RevclustStatus is the main SDK state.

StatusMeaning
disabledRevclust.initialize(...) has not completed in this process yet.
initializingBootstrap or local capture setup is still in flight.
readySetup is healthy.
degradedSetup is unhealthy but not fully broken. Upload connectivity may be down, or local capture may have failed during startup.
misconfiguredThe SDK key is missing, malformed, or otherwise invalid for bootstrap.
notProvisionedThe SDK key is well-formed but unavailable or revoked.
uploadBlockedLocal queueing is still available, but upload is blocked right now.

Upload Snapshot

uploadSnapshot exposes the current queue state and the best-known coarse last error.

MemberMeaning
pendingCountNumber of captures waiting to upload.
uploadingCountNumber of captures currently uploading.
lastErrorCodeBest-known coarse queue or upload failure after the latest problem.

RevclustUploadErrorCode can be one of:

Error codeMeaning
transportUnavailableUpload connectivity is unavailable.
authUpload access is blocked, expired, or otherwise unusable.
misconfigurationConfig is invalid for the current setup.
invalidRequestThe backend rejected the payload or request shape.
quotaExceededThe workspace has reached its captured-incident allowance.
unsupportedSchemaThe backend rejected the incident schema version.
blobTooLargeThe payload exceeded current size limits.
internalErrorLocal capture or the backend failed unexpectedly.

Upload Events

uploadEvents is the later lifecycle stream for a queued capture.

EventMeaning
RevclustUploadStartedUpload work began for a queued capture.
RevclustUploadAcceptedThe backend accepted the capture. Includes RevclustAcceptedResult.
RevclustUploadRejectedThe backend rejected the capture. Includes RevclustRejectionCode and optional message.
RevclustTransportFailureUpload failed before accept or reject was received. Includes statusCode, message, and retryable.

RevclustAcceptedResult exposes:

MemberMeaning
packIdIncident identifier.
schemaVersionAccepted incident schema version.
blobBytesGzipGzipped incident payload size acknowledged by the service.
acceptedAtLocal time when the SDK confirmed the incident was accepted.
viewerUrlOptional direct viewer URL for the accepted incident.

RevclustRejectionCode can be one of:

Rejection codeMeaning
authThe backend rejected authorization.
misconfigurationThe backend rejected the key or setup state.
invalidRequestThe backend rejected request or payload shape.
quotaExceededThe workspace has reached its captured-incident allowance.
unsupportedSchemaThe backend rejected the schema version.
blobTooLargeThe backend rejected the payload because it exceeded the size limit.
internalErrorThe backend failed unexpectedly.

On this page

  1. Canonical Import
  2. Initialization
  3. Core Methods
  4. State Snapshot Provider
  5. Invariant Failure Model
  6. Immediate Capture Outcomes
  7. Status
  8. Upload Snapshot
  9. Upload Events
PrivacyTermsDPA
BlogDocumentationGitHub