Reference

Production rollout

Production capture works, but it's the riskiest mode: real users, real data, real devices. Go through this list before the first store build that records.

  1. Use the right project

    The SDK token (or, in an existing setup, the API URL and ingest key) is compiled into every build. Generate a separate SDK token for store builds in your production project (ask your BugCapsule team for a separate project if QA and production should stay apart). Before rollout, check a release candidate shows both confirmations, Configuration fetched and First event or Capsule received. Never put the bcs_ secret key in an app.

  2. Test the kill switch before you need it

    bugcapsule capture --on       # kill switch ON = capture disabled
    bugcapsule capture            # show config
    bugcapsule capture --off      # resume

    BugCapsule refuses uploads at once. Devices see it at their next settings refresh: after the refresh interval (default 5 min), when the app returns to the foreground, or before an upload with a stale config. They stop recording, drop the buffer, delete queued and saved captures, and keep the switch across launches even offline. An upload already on the wire finishes. Re-enabling applies from the next launch.

  3. Understand capture settings

    Fetched after startup, refreshed every few minutes and on resume, and cached per BugCapsule address and credential (a staging project's settings never apply to production). With no cached settings, debug/QA builds record and production builds sample at the app's cap, but nothing is uploaded until the settings are fetched. Cached settings older than 7 days also stop uploads.

  4. Set sampling

    A production session records with probability min(productionSampleRate, project sample rate), decided at launch. The app's cap (default 0.1) is the ceiling; the project setting can only lower it. Lowering mid-session keeps a recording session with probability new/old. Start low: bugcapsule capture --sample-rate 0.01.

  5. Review redaction on real flows

    Run a real login and payment flow in a QA build, then read the capsule end to end (bugcapsule inspect <id> --json). Add redactKeys, redactPatterns, hooks, exclude rules and sanitizeLocation. See Privacy & redaction.

  6. Decide on bodies

    Turn off captureNetworkBodies (locally or remotely) for anything you can't send. Capsules become partial. Capture never buffers whole bodies: a bounded prefix (256 KiB, binary 64 KiB) while the app gets the stream unchanged.

  7. Check storage allowlists

    Especially Flutter's BugCapsuleSharedPreferences(), which captures every key unless you pass allowPrefixes.

  8. Know the device footprint

    At most 20 saved captures and an outbox of 10 capsules / 10 MiB / 7 days, oldest evicted first; failed uploads back off from 30 s to 1 h. Disk-full and corrupt files drop the capsule, never the app.

  9. Rely on isolation, but verify it

    If storage, an integration or anything in setup fails, the app starts without capture; SDK errors never reach the app's handlers. Test with a read-only or full disk on a QA device.

  10. Measure performance

    Cold start, frame times and memory on a low-end Android device, with and without the SDK. On Flutter, pointer and HTTP capture and redaction run on the UI isolate; encoding runs in a background isolate. The Flutter repo's docs/release-and-device-test-plan.md has the overhead budget.

  11. Pin the build commit in release builds

    Pass the git SHA to every store and production build, the same way as QA builds but without QA mode: Flutter --dart-define=BUGCAPSULE_GIT_SHA=$(git rev-parse HEAD), Android -PbugcapsuleGitSha=$(git rev-parse HEAD), iOS build setting BUGCAPSULE_GIT_SHA (Info.plist BugCapsuleGitSHA), web VITE_BUGCAPSULE_GIT_SHA (or your bundler's equivalent, passed as gitSha). Never add BUGCAPSULE_MODE=qa to a release build. A production capsule without the SHA is partial (build.gitSha), so bugcapsule run can't check out the code that failed and bugcapsule verify has no baseline, so it can't report FIXED (see Verdicts). Check that a capsule from a release candidate carries the commit in source.gitSha (bugcapsule inspect <id> --json).

  12. Confirm release builds can't replay

    Flutter release ignores replay requests; Android needs the androidTest runner and a debuggable build; iOS needs DEBUG; web needs allowReplay: true, which must be false in production builds.

  13. Plan token rotation

    Rotating an SDK token keeps the old one working for the grace period you choose (up to 7 days), then refuses it: builds still carrying it stop uploading and report token_expired. Shipped store builds update slowly, so rotate production tokens only when you must, with the longest grace period, and ship the replacement first. Revoking stops a token at once. An ingest key in an existing setup has no overlap: rotation revokes it immediately. Rotate the secret key and CLI tokens freely.

  14. Agree on data handling

    Retention, share-link policy and how deletion requests are handled. Read what's collected and where it goes with whoever owns privacy in your company, and contact your BugCapsule team for anything that needs changing.

Platform-specific notes

PlatformWatch out for
FlutterOverlay hidden in production by default (showOverlay). BLoC state data in events is off in production unless recordStateData: true.
AndroidEmpty consumer R8 rules and an untested minified build: verify a minified QA build first. Declare INTERNET. No cleartext outside local hosts.
iOSDeclare required-reason APIs (UserDefaults, file timestamps, system uptime) in your privacy manifest. Uploads happen only in the foreground.
WebSet mode explicitly; get your production origin allowed by your BugCapsule team; a refused SDK token or ingest key deletes the local queue.

Monitoring is a separate rollout decision

All four SDKs support monitoring, enabled by default once the SDK is connected. Reducing capsule sampling does not stop error events or release-health sessions. Set error and trace sampling, review user/feedback fields and trace destinations, and exercise monitoring shutdown separately. Follow Monitoring and Release symbols.

Validation boundaries

Simulator and browser-engine tests do not establish physical-device coverage or production overhead budgets. Confirm the documented release gates against your target devices before rollout. A built package is not evidence that every feature has been validated.