Skip to main content

api_studio 1.3.0 copy "api_studio: ^1.3.0" to clipboard
api_studio: ^1.3.0 copied to clipboard

In-app API inspector for Flutter: capture Dio, http or custom requests with redaction, edit & replay, cURL/HAR/Postman export, performance monitor and cloud logs.

Changelog #

1.3.0 #

✨ Added #

  • Crash reporting (opt-in): ApiStudio.initialize(enableCrashReporting: true) reports uncaught Flutter and Dart errors to the portal's new Issues page, where they are grouped by stack trace with event and affected-user counts. Your existing FlutterError.onError / PlatformDispatcher.onError handlers are still called. Requires an apiKey.
  • Each crash carries breadcrumbs: the API calls (method, URL without query string, status, duration) and, with ApiStudioNavigatorObserver, the screens that led up to it.
  • ApiStudio.captureException(error, stackTrace: ..., tags: ..., extra: ..., fingerprint: ...) for errors you catch yourself, and ApiStudio.addBreadcrumb(...) for your own notes.
  • Crash reports are queued on disk and sent on the next launch if the app dies first. The same error is sent at most 3 times per launch.
  • Pair it with alert rules in the portal (new issue, regression, crash spike, API failure spike → Slack, Discord or a webhook).

1.2.0 #

⚠️ Behavior changes #

  • Performance and Files are now opt-in add-ons. API Logs are the core; the other tabs only appear with ApiStudio.initialize(features: {ApiStudioFeature.performance, ApiStudioFeature.fileExplorer}). enablePerformanceMonitoring: true still adds the Performance tab. With no add-ons the API Studio screen has no bottom bar. showPerformanceInspector/showFileExplorer keep working when called directly.

✨ Added #

  • Cloud logs carry a per-launch ApiStudio.sessionId, device/OS info, app version/build/flavor (initialize(appVersion:, appBuild:, appFlavor:)), the tester (ApiStudio.setUser(...)), query parameters, request/response sizes, the truncated flag and the SDK version.

🐛 Fixed #

  • Failed requests never reached the cloud dashboard. Network failures, timeouts and cancellations have no status code; the backend rejected them and the SDK silently discarded them. They are now uploaded.
  • Uploaded logs used the upload time instead of the request time.
  • A revoked key or rate limit (401/403/429) discarded every pending log; the queue is now kept and retried with backoff.
  • failedApiCount only counted errors among the newest 20 logs.
  • flush() returned early while another upload was in flight.

⚡ Performance #

  • Pending cloud uploads are persisted on disk (survive crashes and kills) and sent in gzip batches of up to 50 instead of one request per log.
  • Request/response bodies are stored in a separate lazy box and only read when a log is opened or exported, so they no longer sit in your app's memory.
  • Large bodies (> 32 K characters or big JSON trees) are encoded, redacted and truncated on a background isolate.
  • Opening a large body in the inspector formats it off the UI thread and shows a 64 KB preview with "Show all".
  • JSON/TXT/HAR/Postman exports are redacted and encoded on a background isolate (your custom redaction still applies).
  • New logs arriving while you're scrolled down no longer collapse the list back to the first page.
  • The File Explorer stats files and counts folder contents concurrently; an unreadable folder no longer fails the whole listing.
  • Add-on tabs are built only when first opened; log lookups by id are O(1); list refreshes are coalesced; performance snapshots aren't built when nothing listens.
  • Search also matches HTTP method and exact status code.

🔧 Changed #

  • ApiStudio.sessionId, ApiStudio.setUser(...), ApiStudio.features and ApiStudioFeature are new public API. GetLogsParams gained includeBodies (default true).
  • Storage schema 3: existing logs are migrated in place on first launch.
  • SlackProvider documents that its webhook URL ships inside your app.
  • CI: analysis of the companion packages runs only in their own jobs, and info-level lints are non-fatal (newer Flutter flags every package:flutter/material.dart import as deprecated in favour of package:material_ui, which can't be adopted while Flutter 3.27 is supported).

1.1.0 #

⚠️ Behavior changes — please read #

  • API Studio is now disabled in release builds by default. ApiStudio.initialize() has a new enabled master switch that defaults to kDebugMode. When it is off, every API is a no-op: no local storage, no timers, no frame callbacks, no network calls, no UI. To keep using API Studio in QA/profile/release builds, pass enabled: true.
  • Sensitive data is now redacted before it is stored locally, not just before upload, and also in cURL and every export. Values are replaced with ***REDACTED***. Because headers like Authorization are now stored redacted, Edit & Run shows a warning and you must re-enter those values before replaying.
  • Remote upload now replaces sensitive headers with ***REDACTED*** instead of dropping them, and also redacts JSON body keys and query parameters.
  • Retention: the default maxStoredLogs dropped from 10,000 to 500. Logs older than 7 days (logRetention) are pruned automatically, and total stored body size is capped at ~50 MB.
  • Body limit: the per-body limit went from 64 K characters to 1 MB (maxBodyBytes). Truncated bodies are flagged and end with an explicit marker.
  • The minimum SDK is now Dart 3.6 / Flutter 3.27. These were already required in practice by url_launcher ^6.3.2; the old constraints were inaccurate.
  • show, showNavigation, showFileExplorer and showPerformanceInspector are no-ops until initialize() has completed successfully. Previously they could open screens that crashed on uninitialized storage.

✨ Added #

  • First-class Dio and http support via two optional companion packages, so dio/http are never forced on users who don't need them:
    • api_studio_dio: dio.interceptors.add(ApiStudioDioInterceptor());
    • api_studio_http: ApiStudioHttpClient(inner: http.Client())
    • Both capture URL, method, headers, query, body (incl. multipart descriptors), status, response headers/body, duration, error and stack trace. They handle cancelled requests, timeouts, and binary or oversized bodies, and use the same pipeline as ApiStudio.log.
  • RedactionConfig (redactHeaders, redactBodyKeys, includeDefaults, redactor hook) via ApiStudio.initialize(redaction: ...). Body keys are matched recursively and case-insensitively, ignoring _/-.
  • ApiStudio.initialize(enabled:, logRetention:, maxBodyBytes:, redaction:, navigatorKey:).
  • ApiStudio.isEnabled, ApiStudio.redaction, ApiStudio.maxBodyBytes.
  • ApiStudio.log(...) gained formData, isMultipart, cancelled, requestSizeBytes, responseSizeBytes.
  • ApiStudio.navigatorKey and ApiStudio.open(), to open API Studio without a BuildContext.
  • ApiStudio.showFloatingButton([context]) / hideFloatingButton(): a draggable debug button.
  • HAR 1.2 and Postman Collection v2.1 exports, alongside JSON and TXT.
  • ApiLogEntity.isTruncated.
  • SECURITY.md, and a README "Privacy and data" section.

🔧 Changed #

  • Storage moved from the unmaintained hive/hive_flutter 2.x to hive_ce. The on-disk format is compatible, and existing logs are migrated automatically: logs from ≤ 1.0.7 are re-redacted in place on first launch. Unreadable or corrupt boxes are cleared instead of crashing the app. API Studio no longer calls the global Hive.init, so a host app's own Hive home directory is left alone.
  • Every capture path (ApiStudio.log, interceptors, ApiStudioClient, Edit & Run) now goes through one pipeline: redact → truncate → store → notify → upload.
  • ApiStudioClient is now documented as an optional client for manual testing. Interceptors are the recommended path.
  • Edit & Run now works for requests captured by any integration. It preserves repeated query keys, flattens multi-value headers, and drops stale Content-Length/Host headers. It also warns when the captured request had redacted values, multipart files or a truncated body.
  • Export file names changed from api_inspector_logs.* to api_studio_logs.*.
  • Stricter static analysis (strict-casts, strict-inference, strict-raw-types, and more), with internal widgets now fully typed.
  • Removed the hive_generator and build_runner dev dependencies. The Hive adapter is now hand-written and tolerant of missing or mistyped fields.

🗑️ Deprecated #

  • ApiStudio.init(...): use ApiStudio.initialize(...). It still works and now delegates to initialize. Will be removed in 2.0.0.
  • ApiStudio.initClient(...) (deprecated since 1.0.6): use ApiStudio.initialize(baseUrl: ...).

🐛 Fixed #

  • Log eviction removed the entry with the lexicographically-first UUID key, not the oldest log. Eviction is now by timestamp.
  • Install snippet in the README referenced ^1.0.6.
  • Broken emoji in the README "Export Logs" heading.
  • The package description claimed built-in Dio interception that didn't exist.
  • Tests no longer make real network calls to the API Studio backend.
9
likes
0
points
710
downloads

Publisher

verified publisherapistudio.cloud

Weekly Downloads

In-app API inspector for Flutter: capture Dio, http or custom requests with redaction, edit & replay, cURL/HAR/Postman export, performance monitor and cloud logs.

Repository (GitHub)
View/report issues

Topics

#network #debugging #http #inspector #devtools

License

unknown (license)

Dependencies

equatable, flutter, hive_ce, path_provider, share_plus, url_launcher, web

More

Packages that depend on api_studio