apix 1.1.0 copy "apix: ^1.1.0" to clipboard
apix: ^1.1.0 copied to clipboard

Production-ready Flutter/Dart API client with auth refresh queue, exponential retry, smart caching and error tracking (Sentry-ready). Powered by Dio.

1.1.0 #

Added #

  • authConfig parameter in ApiClientFactory.create - Configure authentication directly
  • retryConfig parameter in ApiClientFactory.create - Configure retry logic directly
  • cacheConfig parameter in ApiClientFactory.create - Configure caching directly
  • loggerConfig parameter in ApiClientFactory.create - Configure logging directly
  • errorTrackingConfig parameter in ApiClientFactory.create - Configure error tracking directly (Sentry, Crashlytics, etc.)
  • metricsConfig parameter in ApiClientFactory.create - Configure request metrics directly

Changed #

  • Renamed captureExceptiononError, addBreadcrumbonBreadcrumb
  • Updated README documentation to match actual API signatures

1.0.0 #

🎉 First Stable Release #

ApiX is now production-ready with a complete feature set for Flutter/Dart API clients.

Features #

  • Core API Client - Dio-powered client with configurable timeouts, headers, and interceptors
  • Authentication - TokenProvider interface with refresh token queue and automatic retry
  • Secure Token Storage - Built-in SecureTokenProvider with flutter_secure_storage
  • Retry Logic - Exponential backoff with configurable status codes and max attempts
  • Smart Caching - CacheFirst, NetworkFirst, and HTTP-aware strategies with TTL
  • Observability - Logger, Metrics, and Sentry interceptors for debugging and monitoring
  • Result Pattern - Functional error handling with Success/Failure types
  • Exception Hierarchy - NetworkException, HttpException, and typed client/server errors

Highlights #

  • 401 tests passing
  • Full API documentation
  • Example app included
  • CI/CD with GitHub Actions

0.3.0 #

Added #

  • SecureStorageService: Wrapper for flutter_secure_storage with simplified API

    • write(key, value), read(key), delete(key), deleteAll()
    • containsKey(key), readAll()
    • Default secure options for Android and iOS
    • Injectable FlutterSecureStorage for custom configuration
  • SecureTokenProvider: Ready-to-use TokenProvider implementation

    • Zero-boilerplate token management
    • Configurable storage keys (accessTokenKey, refreshTokenKey)
    • Exposed storage getter for secondary usage (Firebase tokens, API keys)
    • Works with SecureStorageService via composition
  • Simplified Token Refresh: New refreshEndpoint approach in AuthConfig

    • refreshEndpoint: Relative URL for automatic refresh calls
    • refreshHeaders: Optional custom headers for refresh request
    • onTokenRefreshed: Callback with raw Response for parsing
    • refreshTokenBodyKey: Configurable body key (default: 'refresh_token')
    • hasSimplifiedRefresh: Getter to check if simplified flow is configured

Changed #

  • AuthInterceptor now supports both simplified and legacy refresh flows
  • Simplified flow takes priority when refreshEndpoint is configured

Backward Compatibility #

  • Existing onRefresh callback still works as before
  • All new fields are optional with sensible defaults

0.0.1 #

  • Initial release with core features:
    • ApiClient with configurable timeouts and interceptors
    • TokenProvider interface for authentication
    • AuthInterceptor with refresh token queue
    • RetryInterceptor with exponential backoff
    • CacheInterceptor with multiple strategies
    • LoggerInterceptor for debugging
    • ErrorTrackingInterceptor for error reporting
    • Result pattern for functional error handling
2
likes
0
points
156
downloads

Publisher

unverified uploader

Weekly Downloads

Production-ready Flutter/Dart API client with auth refresh queue, exponential retry, smart caching and error tracking (Sentry-ready). Powered by Dio.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

crypto, dio, flutter, flutter_secure_storage, sentry_flutter

More

Packages that depend on apix