northlight_sdk 0.7.15
northlight_sdk: ^0.7.15 copied to clipboard
Flutter SDK for Northlight feedback and bug reporting system. Collect user feedback, bug reports, and display roadmaps in your Flutter apps.
Northlight SDK for Flutter #
Flutter SDK for the Northlight feedback and bug reporting system. Collect user feedback, bug reports, and display roadmaps in your Flutter apps.
Auto-Update Feature #
This Flutter SDK automatically uses the latest versions of the native Northlight SDKs:
- iOS: Downloads the latest version from GitHub releases during
pod install - Android: Uses the latest version from Maven Central during build
To check the latest available versions:
./check_versions.sh
Features #
- π Bug Reporting: Let users report bugs with device information automatically included
- π‘ Feature Requests: Collect feature requests and feedback from your users
- π Public Feedback: Display and vote on public feature requests
- πΊοΈ Roadmap: Show your product roadmap to users
- π Multi-language: Supports 8 languages
- π± Native UI: Uses native iOS (SwiftUI) and Android (Compose) interfaces
- π Programmatic API: Submit feedback and bugs without UI
Requirements #
- Flutter SDK: >=3.3.0
- Dart SDK: >=3.8.1
- iOS: >=17.0
- Android: API 26+ (Android 8.0+)
Installation #
Add northlight_sdk to your pubspec.yaml:
dependencies:
northlight_sdk: ^0.7.14
Run flutter pub get to install the package.
iOS Setup #
No additional setup required. The iOS SDK will be automatically downloaded during pod install.
Android Setup #
No additional setup required. The Android SDK will be automatically downloaded from Maven Central during build.
Usage #
Quick Start #
import 'package:northlight_sdk/northlight_sdk.dart';
// Configure the SDK with your API key
await Northlight.configure('YOUR_API_KEY');
// Optional: Set user identification
await Northlight.setUserIdentifier('user_123');
await Northlight.setUserEmail('[email protected]');
// Present the bug report view
await Northlight.presentBugReportView();
UI Presentation Methods #
Present native UI screens for various functions:
// Bug report form
await Northlight.presentBugReportView();
// Feature request form
await Northlight.presentFeedbackView();
// Public feedback list with voting
await Northlight.presentPublicFeedbackView();
// Product roadmap
await Northlight.presentRoadmapView();
Programmatic API #
Submit feedback and bugs without showing UI:
// Submit feedback
try {
final feedbackId = await Northlight.submitFeedback(
title: 'Add dark mode',
description: 'It would be great to have a dark mode option',
category: 'UI/UX',
);
print('Feedback submitted with ID: $feedbackId');
} on NorthlightError catch (e) {
print('Error: $e');
}
// Report a bug
try {
final bugId = await Northlight.reportBug(
title: 'App crashes on startup',
description: 'The app crashes when I try to open it',
severity: BugSeverity.high,
stepsToReproduce: '1. Open the app\n2. See crash',
);
print('Bug reported with ID: $bugId');
} on NorthlightError catch (e) {
print('Error: $e');
}
// Get public feedback
final feedback = await Northlight.getPublicFeedback();
for (final item in feedback) {
print('${item.title} - ${item.voteCount} votes');
}
// Vote on feedback
final newVoteCount = await Northlight.vote('feedback_id_here');
print('New vote count: $newVoteCount');
// Get roadmap
final roadmap = await Northlight.getRoadmap();
for (final item in roadmap) {
print('${item.title} - ${item.status}');
}
Error Handling #
The SDK uses a custom NorthlightError class for error handling:
try {
await Northlight.configure('invalid_key');
} on NorthlightError catch (e) {
switch (e.code) {
case 'not_configured':
print('SDK not configured');
break;
case 'invalid_api_key':
print('Invalid API key');
break;
case 'network_error':
print('Network error: ${e.message}');
break;
case 'rate_limit_exceeded':
print('Rate limit exceeded');
break;
default:
print('Error: $e');
}
}
Data Models #
Feedback #
class Feedback {
final String id;
final String projectId;
final String title;
final String description;
final String status;
final String? category;
final int voteCount;
final String createdAt;
final String updatedAt;
}
Bug #
class Bug {
final String id;
final String projectId;
final String title;
final String description;
final String status;
final BugSeverity severity;
final String? stepsToReproduce;
final DeviceInfo deviceInfo;
final String createdAt;
}
enum BugSeverity { low, medium, high }
RoadmapItem #
class RoadmapItem {
final String id;
final String title;
final String description;
final String status;
final String priority;
final String? estimatedDate;
final String? completedDate;
final List<String> feedbackIds;
}
Example #
See the example directory for a complete sample app demonstrating all features of the SDK.
// Example app initialization
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
home: HomePage(),
);
}
}
class HomePage extends StatefulWidget {
@override
void initState() {
super.initState();
// Initialize SDK
Northlight.configure('YOUR_API_KEY');
}
// ... rest of implementation
}
Localization #
The SDK supports the following languages through the native SDKs:
- English (en)
- German (de)
- Spanish (es)
- French (fr)
- Italian (it)
- Portuguese (pt)
- Russian (ru)
- Turkish (tr)
- Chinese Simplified (zh-CN) - Android only
Platform Differences #
While the Flutter SDK provides a unified API, there are some platform-specific differences:
iOS #
- Uses SwiftUI for native views
- Stores votes in UserDefaults
- Supports iOS 17.0+
Android #
- Uses Jetpack Compose for native views
- Stores votes in DataStore
- Supports Android API 26+
- Additional language support (Chinese Simplified)
Troubleshooting #
iOS Build Issues #
- Ensure you have the correct pod sources in your Podfile
- Run
pod repo updateif you encounter pod installation issues - Minimum iOS deployment target must be 17.0
Android Build Issues #
- Ensure minimum SDK version is 26 in your
android/app/build.gradle - Add the Northlight Maven repository to your project
- Check that you have the required Kotlin version (2.0.21+)
Configuration Issues #
- Ensure you call
Northlight.configure()before any other SDK methods - API key must be valid for your project
- Check network connectivity for API calls
Support #
For issues and feature requests, please visit:
License #
This SDK is proprietary software. See LICENSE file for details.