boogi_flutter_sdk
A Flutter SDK for embedding Boogi's catalogue widget securely using a login token.
๐ Features
- Embeds Boogi's offer catalogue inside your app via WebView using our end user token-based sessions.
- Simple integration with a single method call to initialize and display the widget.
๐ Please refer to the full documentation for authentication and session handling:
Boogi API Docs - Client Authentication
๐ Installation
Add to your pubspec.yaml
:
dependencies:
boogi_flutter_sdk: ^1.0.0
Then run:
flutter pub get
๐งโ๐ป Usage
1. Initialize a Session
Before rendering the widget, you must start a session using a valid Boogi session token. This should be done at the beginning of your app:
void main() {
Boogi.startSession("YOUR_SESSION_TOKEN"); // Replace with your actual session token
runApp(const MyApp());
}
โน๏ธ You can obtain session tokens from your backend using Boogiโs secure authentication APIs.
2. Display the Catalogue Widget
Embed the Boogi catalogue widget into your Flutter app using the Boogi.getWidget()
method.
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(title: const Text('Boogi Demo')),
body: Boogi.getWidget(), // Renders the embedded WebView
),
);
}
}
This renders a WebView with the Boogi catalogue based on your session configuration.
๐งฉ Full Example
import 'package:flutter/material.dart';
import 'package:boogi_flutter_sdk/boogi_flutter_sdk.dart';
void main() {
Boogi.startSession("YOUR_SESSION_TOKEN"); // Sample session token
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(title: const Text('Boogi Demo')),
body: Boogi.getWidget(),
),
);
}
}
๐ Notes
- The WebView content and behavior are configured on the Boogi backend based on your session token.
- Make sure you handle session generation securely on your backend.
- Widget behavior may vary based on the tokenโs user permissions and configuration.
๐ฉ Support
Need help? Reach out to us via the Boogi dashboard or consult the Boogi Developer Docs.