Revclust
DocsPricing
Log inStart free
DocsPricingLog 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_sdk/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 reproduction-condition metadata attached to captured packs. They do not affect bootstrap routing 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)Optional network hook API. Not part of the default hosted setup path.
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.
enableUnhandledExceptionCapture()Optional unhandled-exception hook API. Not part of the default hosted setup path.

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. The failure is a factual oracle: what failure class occurred, what primary subject it concerns, what was expected, and what was observed.

The public API does not ask app code for authored incident prose. Do not wire reason, signature, reproHint, stepLabel, or relevantIds for new app-owned captures. Legacy packs may still contain older trigger fields, but new captures should use failureKind, subject, expected, and observed.

TypePurpose
RevclustInvariantFailure.failureKindStable failure class, title, and grouping key.
RevclustInvariantFailure.subjectPrimary reproduction anchor, 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.
unsupportedSchemaThe backend rejected the pack schema version.
blobTooLargeThe payload exceeded current hosted 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 pack schema version.
blobBytesGzipGzipped pack size acknowledged by the backend.
acceptedAtLocal time the SDK confirmed hosted acceptance.
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.
unsupportedSchemaThe backend rejected the schema version.
blobTooLargeThe backend rejected the pack size.
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
TermsPrivacy Policy