coolfix_flutter 0.1.0
coolfix_flutter: ^0.1.0 copied to clipboard
CoolFix support inquiry and replay SDK for Flutter applications.
CoolFix for Flutter #
CoolFix connects customer inquiries, user context, and the relevant session in one support workflow. Your app only needs the CoolFix package and the App Token issued in the CoolFix dashboard.
Availability #
The package is being prepared for its first pub.dev release. Do not add
coolfix_flutter: ^0.1.0 until the package is visible at
https://pub.dev/packages/coolfix_flutter.
The API below documents the planned 0.1.0 integration contract.
Start CoolFix before runApp, then wrap the app once with CoolFixApp:
Future<void> main() async {
WidgetsFlutterBinding.ensureInitialized();
await CoolFix.start(const String.fromEnvironment('COOLFIX_APP_TOKEN'));
runApp(const CoolFixApp(child: MyApp()));
}
Pass the token without committing it to source control:
flutter run --dart-define=COOLFIX_APP_TOKEN=cfx_pub_your_app
No navigation observer or additional service configuration is required.
Connect users #
Call identify after login succeeds and reset when logout completes. Only
pass user properties that your product intends to show in support context.
await CoolFix.identify(
user.id,
name: user.name,
email: user.email,
properties: {'plan': user.plan},
);
await CoolFix.reset();
Receive inquiries #
Open the managed inquiry screen from any context under a Navigator:
await CoolFix.presentInquiry(context);
If your app has its own inquiry UI, submit its text directly instead:
final receipt = await CoolFix.submitInquiry(text);
The managed screen prevents duplicate submissions, preserves the draft after a failure, and presents safe loading, success, and error states. Inquiry delivery continues even when session context is temporarily unavailable.