Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 12 additions & 11 deletions llms.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<!-- repo: clix-so/clix-flutter-sdk -->
<!-- ref: main -->
<!-- commit: bd8582f32d7042085d16f3480bedc1c0710e9a42 -->
<!-- generated_at: 2025-12-02T02:04:40Z -->
<!-- commit: a692fb6f97f9dd6204273c564ccff80f33f621aa -->
<!-- generated_at: 2026-02-13T04:55:39Z -->
# Platform: Flutter

## /
- [Readme](https://raw.githubusercontent.com/clix-so/clix-flutter-sdk/main/README.md): Developer-facing README providing installation, configuration, and usage guidance for the Clix Flutter SDK, including initialization via `Clix.initialize`, user management APIs, Firebase-based push notification integration, platform setup steps, error handling, and sample app references.
- [Changelog](https://raw.githubusercontent.com/clix-so/clix-flutter-sdk/main/CHANGELOG.md): Documents versioned SDK changes (per Keep a Changelog / SemVer), including core initialization, user management, push notification integration, device/logging features, installation requirements, and updates such as the ClixAPIClient default `User-Agent` header behavior.
- [Changelog](https://raw.githubusercontent.com/clix-so/clix-flutter-sdk/main/CHANGELOG.md): Changelog documenting semver releases and notable changes—adds SESSION_START session tracking; Push Notifications API (Clix.Notification with onMessage/onBackgroundMessage/onNotificationOpened/onFcmTokenError, getToken/deleteToken, permission APIs, configure opts); MMKV storage migration; ClixConfig/ClixAPIClient, user/device APIs and platform requirements.
- [License](https://raw.githubusercontent.com/clix-so/clix-flutter-sdk/main/LICENSE): Defines the project’s modified MIT-style license, granting standard use/modify/distribute rights while restricting all substantial use to Clix-provided services and disallowing repurposing for unrelated platforms without explicit permission.

## android/src/main/kotlin/so/clix
Expand All @@ -26,16 +26,16 @@
- [Clix Flutter](https://raw.githubusercontent.com/clix-so/clix-flutter-sdk/main/lib/clix_flutter.dart): Primary library entrypoint that re-exports core Clix SDK configuration/runtime (`clix.dart`, `clix_config.

## lib/src/core
- [Clix Config.g](https://raw.githubusercontent.com/clix-so/clix-flutter-sdk/main/lib/src/core/clix_config.g.dart): Generated `json_serializable` helpers for `ClixConfig`, providing `_$ClixConfigFromJson`/`_$ClixConfigToJson` for JSON mapping, default endpoint/log level handling, extraHeaders map conversion, and enum–string mapping via `_$ClixLogLevelEnumMap`.
- [Clix Config.g](https://raw.githubusercontent.com/clix-so/clix-flutter-sdk/main/lib/src/core/clix_config.g.dart): Generated json_serializable helpers for ClixConfig: _$ClixConfigFromJson/_$ClixConfigToJson and enum map, performing Map↔ClixConfig conversion, casting fields, applying defaults (endpoint 'https://api.clix.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep ClixConfig entry from truncating default endpoint

This regenerated line is truncated mid-sentence at https://api.clix. (with an unclosed parenthetical), so the index no longer communicates the actual default endpoint (https://api.clix.so) and full config behavior. Because llms.txt is intended as machine-consumable documentation, this introduces inaccurate metadata for ClixConfig consumers and regresses the previous complete description.

Useful? React with 👍 / 👎.

- [Clix Version](https://raw.githubusercontent.com/clix-so/clix-flutter-sdk/main/lib/src/core/clix_version.dart): Provides a lazily-resolved, cached SDK version string via `ClixVersion.version`, using `package_info_plus`’s `PackageInfo.
- [Clix](https://raw.githubusercontent.com/clix-so/clix-flutter-sdk/main/lib/src/core/clix.dart): Central entrypoint singleton that initializes Clix services (storage, API client, device, events, notifications), manages SDK configuration and logging, and exposes public static APIs for user identity/properties, device ID, push token retrieval, and event tracking.
- [Clix](https://raw.githubusercontent.com/clix-so/clix-flutter-sdk/main/lib/src/core/clix.dart): Clix is a singleton SDK facade that initializes storage, ClixAPIClient, Token/Device/Event/Session/Notification services, persists config (projectId/apiKey), starts sessions / notification handling, and exposes initialize, Notification, setUserId/properties/remove/getDeviceId/trackEvent, setLogLevel, and init-wait/error wrapping.
- [Clix Notification](https://raw.githubusercontent.com/clix-so/clix-flutter-sdk/main/lib/src/core/clix_notification.dart): Manages push notifications (FirebaseMessaging) for Clix: exposes configure, requestPermission, getPermissionStatus, setPermissionGranted (syncs to server), getToken, deleteToken and handler registration (onMessage/onBackgroundMessage/onNotificationOpened/onFcmTokenError), with init gating and error logging.
- [Clix Config](https://raw.githubusercontent.com/clix-so/clix-flutter-sdk/main/lib/src/core/clix_config.dart): Defines the immutable `ClixConfig` JSON-serializable configuration model (projectId, apiKey, endpoint, logLevel, extraHeaders) used to initialize the SDK, with `toJson`/`fromJson` generated via `json_annotation` and dependent on `ClixLogLevel`.
- [Clix Config.g](https://raw.githubusercontent.com/clix-so/clix-flutter-sdk/main/lib/src/core/clix_config.g.dart): Generated `json_serializable` helpers for `ClixConfig`, providing `_$ClixConfigFromJson`/`_$ClixConfigToJson` for JSON mapping, default endpoint/log level handling, extraHeaders map conversion, and enum–string mapping via `_$ClixLogLevelEnumMap`.
- [Clix Config](https://raw.githubusercontent.com/clix-so/clix-flutter-sdk/main/lib/src/core/clix_config.dart): Immutable JSON-serializable ClixConfig model (json_annotation) holding SDK settings—projectId, apiKey, endpoint (default https://api.clix.
- [Clix Config.g](https://raw.githubusercontent.com/clix-so/clix-flutter-sdk/main/lib/src/core/clix_config.g.dart): Generated json_serializable helpers for ClixConfig: _$ClixConfigFromJson/_$ClixConfigToJson and enum map, performing Map↔ClixConfig conversion, casting fields, applying defaults (endpoint 'https://api.clix.
- [Clix Version](https://raw.githubusercontent.com/clix-so/clix-flutter-sdk/main/lib/src/core/clix_version.dart): Provides a lazily-resolved, cached SDK version string via `ClixVersion.version`, using `package_info_plus`’s `PackageInfo.
- [Clix](https://raw.githubusercontent.com/clix-so/clix-flutter-sdk/main/lib/src/core/clix.dart): Central entrypoint singleton that initializes Clix services (storage, API client, device, events, notifications), manages SDK configuration and logging, and exposes public static APIs for user identity/properties, device ID, push token retrieval, and event tracking.
- [Clix](https://raw.githubusercontent.com/clix-so/clix-flutter-sdk/main/lib/src/core/clix.dart): Clix is a singleton SDK facade that initializes storage, ClixAPIClient, Token/Device/Event/Session/Notification services, persists config (projectId/apiKey), starts sessions / notification handling, and exposes initialize, Notification, setUserId/properties/remove/getDeviceId/trackEvent, setLogLevel, and init-wait/error wrapping.
- [Clix Notification](https://raw.githubusercontent.com/clix-so/clix-flutter-sdk/main/lib/src/core/clix_notification.dart): ClixNotification manages push notification lifecycle and handlers in the Clix SDK—wrapping FirebaseMessaging via Clix services to request/get permissions, sync server push permission, fetch/delete FCM tokens, toggle autoHandleLandingURL, and register onMessage/onBackgroundMessage/onNotificationOpened/onFcmTokenError callbacks while logging errors.
- [Clix Config](https://raw.githubusercontent.com/clix-so/clix-flutter-sdk/main/lib/src/core/clix_config.dart): Defines the immutable `ClixConfig` JSON-serializable configuration model (projectId, apiKey, endpoint, logLevel, extraHeaders) used to initialize the SDK, with `toJson`/`fromJson` generated via `json_annotation` and dependent on `ClixLogLevel`.
- [Clix Config](https://raw.githubusercontent.com/clix-so/clix-flutter-sdk/main/lib/src/core/clix_config.dart): Immutable JSON-serializable ClixConfig model (json_annotation) holding SDK settings—projectId, apiKey, endpoint (default https://api.clix.

## lib/src/models
- [Clix Push Notification Payload](https://raw.githubusercontent.com/clix-so/clix-flutter-sdk/main/lib/src/models/clix_push_notification_payload.dart): Defines the `ClixPushNotificationPayload` JSON-serializable model for push message metadata (IDs, URLs, custom properties), providing `fromJson`/`toJson` via `json_serializable` and value semantics where equality and hashing are based solely on `messageId`.
Expand All @@ -58,19 +58,20 @@
- [Messages.g](https://raw.githubusercontent.com/clix-so/clix-flutter-sdk/main/lib/src/platform/messages.g.dart): Autogenerated Pigeon message definitions for the Flutter–host bridge, providing a custom `_PigeonCodec` (int handling) and the `ClixHostApi` entry point that configures the `BinaryMessenger` and channel name suffix for platform message channels.

## lib/src/services
- [Session Service](https://raw.githubusercontent.com/clix-so/clix-flutter-sdk/main/lib/src/services/session_service.dart): SessionService observes app lifecycle, persists last-activity in StorageService, and emits a 'SESSION_START' event via EventService when resuming after timeout (min 5s), exposing start(), setPendingMessageId(), and cleanup() as public entry points.
- [Clix Api Client](https://raw.githubusercontent.com/clix-so/clix-flutter-sdk/main/lib/src/services/clix_api_client.dart): HTTP client wrapper that builds `/api/v1` URIs from `ClixConfig`, injects versioned common headers (project ID, API key, extra headers, User-Agent), logs requests/responses, and exposes `get`, `post`, `put`, `delete`, and `close` methods using `package:http`.
- [Token Service](https://raw.githubusercontent.com/clix-so/clix-flutter-sdk/main/lib/src/services/token_service.dart): Manages push token lifecycle using `StorageService`, providing retrieval (`getCurrentToken`, `getPreviousTokens`), persistence with deduped/limited history (`saveToken`), conversion from byte device tokens (`convertTokenToString`), and full cleanup/reset (`clearTokens`, `reset`) with `ClixLogger` error/debug logging.
- [Event Api Service](https://raw.githubusercontent.com/clix-so/clix-flutter-sdk/main/lib/src/services/event_api_service.dart): Provides `EventAPIService.trackEvent`, which logs, constructs the `/events` request payload (device_id, name, custom_properties, optional message_id), posts via `ClixAPIClient`, validates HTTP 2xx responses, and logs or rethrows on failure using `ClixLogger`.
- [Device Service](https://raw.githubusercontent.com/clix-so/clix-flutter-sdk/main/lib/src/services/device_service.dart): Manages device identity and metadata, mapping local storage, token management, and platform/app info into `ClixDevice` models and delegating to `DeviceAPIService` to register devices, bind/unbind project user IDs, and upsert/remove user properties and push tokens.
- [Notification Service](https://raw.githubusercontent.com/clix-so/clix-flutter-sdk/main/lib/src/services/notification_service.dart): Implements `NotificationService`, a singleton that wires Firebase Cloud Messaging with flutter_local_notifications to manage permission requests, topic subscriptions, FCM token persistence/registration, Clix payload parsing, event tracking, deep-link/URL handling, and foreground/background notification display and callbacks.
- [Notification Service](https://raw.githubusercontent.com/clix-so/clix-flutter-sdk/main/lib/src/services/notification_service.dart): NotificationService manages FCM integration and FlutterLocalNotifications display (foreground, background and background handler), token lifecycle/registration with DeviceService, event tracking via EventService, payload parsing/URL navigation/image downloading; public API: initialize(), requestNotificationPermission(), getCurrentToken(), deleteToken(), subscribe/unsubscribe, setNotificationPreferences.
- [Event Service](https://raw.githubusercontent.com/clix-so/clix-flutter-sdk/main/lib/src/services/event_service.dart): Provides `EventService.trackEvent` to send cleaned, device-scoped analytics events via `EventAPIService`, resolving the current device ID from `DeviceService`, logging with `ClixLogger`, and rethrowing failures (typically when `Clix.
- [Storage Service](https://raw.githubusercontent.com/clix-so/clix-flutter-sdk/main/lib/src/services/storage_service.dart): JSON-backed key–value storage abstraction over `SharedPreferences` that lazily initializes preferences, logs lifecycle events via `ClixLogger`, transparently migrates legacy string values, and exposes generic `set<T>`, `get<T>`, and `remove` APIs for SDK data persistence.
- [Device Api Service](https://raw.githubusercontent.com/clix-so/clix-flutter-sdk/main/lib/src/services/device_api_service.dart): Defines `DeviceAPIService`, a wrapper around `ClixAPIClient` that logs and performs HTTP POST/DELETE calls to register devices, bind/unbind project user IDs, and upsert/remove `ClixUserProperty` values for a given device, throwing on non-2xx responses.
- [Clix Api Client](https://raw.githubusercontent.com/clix-so/clix-flutter-sdk/main/lib/src/services/clix_api_client.dart): HTTP client wrapper that builds `/api/v1` URIs from `ClixConfig`, injects versioned common headers (project ID, API key, extra headers, User-Agent), logs requests/responses, and exposes `get`, `post`, `put`, `delete`, and `close` methods using `package:http`.
- [Token Service](https://raw.githubusercontent.com/clix-so/clix-flutter-sdk/main/lib/src/services/token_service.dart): Manages push token lifecycle using `StorageService`, providing retrieval (`getCurrentToken`, `getPreviousTokens`), persistence with deduped/limited history (`saveToken`), conversion from byte device tokens (`convertTokenToString`), and full cleanup/reset (`clearTokens`, `reset`) with `ClixLogger` error/debug logging.
- [Event Api Service](https://raw.githubusercontent.com/clix-so/clix-flutter-sdk/main/lib/src/services/event_api_service.dart): Provides `EventAPIService.trackEvent`, which logs, constructs the `/events` request payload (device_id, name, custom_properties, optional message_id), posts via `ClixAPIClient`, validates HTTP 2xx responses, and logs or rethrows on failure using `ClixLogger`.
- [Device Service](https://raw.githubusercontent.com/clix-so/clix-flutter-sdk/main/lib/src/services/device_service.dart): Manages device identity and metadata, mapping local storage, token management, and platform/app info into `ClixDevice` models and delegating to `DeviceAPIService` to register devices, bind/unbind project user IDs, and upsert/remove user properties and push tokens.
- [Notification Service](https://raw.githubusercontent.com/clix-so/clix-flutter-sdk/main/lib/src/services/notification_service.dart): Implements `NotificationService`, a singleton that wires Firebase Cloud Messaging with flutter_local_notifications to manage permission requests, topic subscriptions, FCM token persistence/registration, Clix payload parsing, event tracking, deep-link/URL handling, and foreground/background notification display and callbacks.
- [Notification Service](https://raw.githubusercontent.com/clix-so/clix-flutter-sdk/main/lib/src/services/notification_service.dart): NotificationService manages FCM integration and FlutterLocalNotifications display (foreground, background and background handler), token lifecycle/registration with DeviceService, event tracking via EventService, payload parsing/URL navigation/image downloading; public API: initialize(), requestNotificationPermission(), getCurrentToken(), deleteToken(), subscribe/unsubscribe, setNotificationPreferences.
- [Event Service](https://raw.githubusercontent.com/clix-so/clix-flutter-sdk/main/lib/src/services/event_service.dart): Provides `EventService.trackEvent` to send cleaned, device-scoped analytics events via `EventAPIService`, resolving the current device ID from `DeviceService`, logging with `ClixLogger`, and rethrowing failures (typically when `Clix.
- [Storage Service](https://raw.githubusercontent.com/clix-so/clix-flutter-sdk/main/lib/src/services/storage_service.dart): JSON-backed key–value storage abstraction over `SharedPreferences` that lazily initializes preferences, logs lifecycle events via `ClixLogger`, transparently migrates legacy string values, and exposes generic `set<T>`, `get<T>`, and `remove` APIs for SDK data persistence.
- [Device Api Service](https://raw.githubusercontent.com/clix-so/clix-flutter-sdk/main/lib/src/services/device_api_service.dart): Defines `DeviceAPIService`, a wrapper around `ClixAPIClient` that logs and performs HTTP POST/DELETE calls to register devices, bind/unbind project user IDs, and upsert/remove `ClixUserProperty` values for a given device, throwing on non-2xx responses.
Expand Down