Octopus SDK for Flutter
White-label social community SDK for Flutter β embed a fully moderated community feed, profiles, notifications and more directly inside your app, with your own branding.
π Full documentation: doc.octopuscommunity.com β the canonical, always-up-to-date integration guide. This README is a quick start; the documentation covers every API in depth and states each feature's availability per platform (iOS, Android, Flutter).
Features
- π§© Embedded community UI β drop the
OctopusHomeScreenwidget anywhere in your widget tree - π€ SSO user management β connect / disconnect your own users with a signed JWT (token provider)
- π¨ Theming β primary colors, font sizes, custom logo, light / dark mode
- π§ Open a specific screen β open straight onto a post, a group, or the post editor
- π Multi-community β switch the active community at runtime
- π Bridges β link your own content (articles, productsβ¦) to auto-created community posts, with live reaction / comment / view counts
- ποΈ Groups β observe the community's groups and the user's follow state
- π Push notifications & an unseen-notifications badge stream
- π§ͺ A/B testing β gate community access with a reactive stream
- π URL interception & locale override
- π Custom analytics & a typed SDK event stream
- π Custom API endpoint β route SDK traffic to a custom host (
ApiServer)
Requirements
| Tool / platform | Minimum |
|---|---|
| Flutter | 3.10 |
| Dart | 3.0 |
| Android | minSdk 21, compileSdk 35 |
| iOS | 14.0 |
Installation
Add the dependency to your pubspec.yaml:
dependencies:
octopus_sdk_flutter: ^1.12.0
Then run:
flutter pub get
Android setup
-
Make your
MainActivityextendFlutterFragmentActivity(required for the embedded UI):import io.flutter.embedding.android.FlutterFragmentActivity class MainActivity : FlutterFragmentActivity() -
Target the right SDK levels in
android/app/build.gradle:android { compileSdk 35 defaultConfig { minSdk 21 } } -
Add the internet permission to
android/app/src/main/AndroidManifest.xml:<uses-permission android:name="android.permission.INTERNET" />
iOS setup
Configure ios/Podfile:
platform :ios, '14.0'
target 'Runner' do
use_frameworks! :linkage => :static
use_modular_headers!
# ... flutter_install_all_ios_pods ...
end
post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_ios_build_settings(target)
target.build_configurations.each do |config|
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '14.0'
config.build_settings['ENABLE_USER_SCRIPT_SANDBOXING'] = 'NO'
end
end
end
Then install the pods:
cd ios && pod install
gRPC module conflict: if
pod installreports a duplicategRPCmodule, keepuse_modular_headers!(above), or addpod 'gRPC-Swift', :modular_headers => trueto yourPodfile.
Quick start
import 'package:octopus_sdk_flutter/octopus_sdk_flutter.dart';
final octopus = OctopusSDK();
// 1. Initialize as early as possible (SSO mode).
await octopus.initialize(
apiKey: 'YOUR_API_KEY',
// appManagedFields: [ProfileField.nickname, ProfileField.picture],
);
// 2. Connect your user. The token provider returns a signed JWT minted by your
// backend (see "Generate a signed JWT for SSO" in the documentation).
await octopus.connectUserWithTokenProvider(
userId: yourUserId,
nickname: yourUserNickname,
tokenProvider: () async => fetchOctopusTokenFromYourBackend(),
);
// 3. Display the community anywhere in your widget tree.
OctopusHomeScreen(
onNavigateToLogin: () {
// Launch your own login flow, then call connectUser*.
},
onModifyUser: (field) {
// Open your own profile editor for the requested field.
},
);
// 4. Disconnect on sign-out.
await octopus.disconnectUser();
β Step-by-step guide: SDK Setup Guide.
New in 1.12.0
Custom API endpoint (ApiServer), multi-community switchCommunity, SDK lifecycle (reset / stop / isInitialised), the community groups stream, the connected-user profile stream, setReaction on any post, the Bridge post API (fetchOrCreateClientObjectRelatedPost, getClientObjectRelatedPostFlow, β¦), "open a specific screen" (initialScreen), the in-app post editor (showOctopusCreatePostScreen), and the formatOctopusCompactCount helper. See the CHANGELOG for the complete list and migration notes.
Example app
A full demo lives in example/ β initialization, SSO, theming, and feature scenarios. To run it you need a sandbox community: an API key and an SSO JWT secret.
cd example
flutter pub get
flutter run
Documentation & support
- π Integration guide: doc.octopuscommunity.com
- π Website: octopuscommunity.com
- π Issues: github.com/Octopus-Community/octopus-sdk-flutter/issues
License
Licensed under the Octopus Community Mobile SDK License Agreement β see LICENSE.