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.
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.Test the kill switch before you need it
bugcapsule capture --on # kill switch ON = capture disabled bugcapsule capture # show config bugcapsule capture --off # resumeBugCapsule 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.
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.
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.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). AddredactKeys,redactPatterns, hooks,excluderules andsanitizeLocation. See Privacy & redaction.Decide on bodies
Turn off
captureNetworkBodies(locally or remotely) for anything you can't send. Capsules becomepartial. Capture never buffers whole bodies: a bounded prefix (256 KiB, binary 64 KiB) while the app gets the stream unchanged.Check storage allowlists
Especially Flutter's
BugCapsuleSharedPreferences(), which captures every key unless you passallowPrefixes.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.
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.
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.mdhas the overhead budget.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 settingBUGCAPSULE_GIT_SHA(Info.plistBugCapsuleGitSHA), webVITE_BUGCAPSULE_GIT_SHA(or your bundler's equivalent, passed asgitSha). Never addBUGCAPSULE_MODE=qato a release build. A production capsule without the SHA ispartial(build.gitSha), sobugcapsule runcan't check out the code that failed andbugcapsule verifyhas no baseline, so it can't reportFIXED(see Verdicts). Check that a capsule from a release candidate carries the commit insource.gitSha(bugcapsule inspect <id> --json).Confirm release builds can't replay
Flutter release ignores replay requests; Android needs the androidTest runner and a debuggable build; iOS needs
DEBUG; web needsallowReplay: true, which must befalsein production builds.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.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
| Platform | Watch out for |
|---|---|
| Flutter | Overlay hidden in production by default (showOverlay). BLoC state data in events is off in production unless recordStateData: true. |
| Android | Empty consumer R8 rules and an untested minified build: verify a minified QA build first. Declare INTERNET. No cleartext outside local hosts. |
| iOS | Declare required-reason APIs (UserDefaults, file timestamps, system uptime) in your privacy manifest. Uploads happen only in the foreground. |
| Web | Set 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.