Support Portal Flutter SDK
Plug-and-play Flutter SDK for integrating Support Portal into any Flutter app.
Credentials: SupportPortalConfig must include platformId and appId from Admin Dashboard → Apps (/dashboard/apps). Same contract as the Web SDK. See Integration overview.
Installation
Add to pubspec.yaml:
dependencies:
clariconops: ^1.0.0
Quick Start
import 'package:clariconops/support_portal.dart';
import 'package:clariconops/support_portal_config.dart';
import 'package:clariconops/support_portal_user.dart';
// 1. Initialize
SupportPortal.init(SupportPortalConfig(
domain: 'mycompany',
platformId: 'plt_abc',
appId: 'app_xyz',
apiUrl: 'https://api.example.com',
));
// 2. Identify user
SupportPortal.setUser(SupportPortalUser(
externalId: 'user_123',
name: 'John Doe',
email: 'john@example.com',
));
// 3. Custom data
SupportPortal.setCustomFields({'level': 42, 'plan': 'premium'});
SupportPortal.setTags(['flutter', 'vip']);
// 4. Open UI
SupportPortal.openConversations(context);
SupportPortal.openNewConversation(context);
SupportPortal.openHelpCenter(context);
// 5. Listen for events
SupportPortal.instance.events.listen((event) {
if (event['type'] == 'ticket:created') {
print('Ticket created: ${event['ticketId']}');
}
});
Widget Embedding
Use SupportPortalView directly in your widget tree:
SupportPortalView(
mode: 'conversations',
onEvent: (event) => print(event),
onClose: () => Navigator.pop(context),
)
Requirements
- Flutter 3.10+
- Dart 3.0+
webview_flutter^4.4.0