social_auth_sdk Pro
Social authentication feature SDK with per-provider packages (Google, Apple, Facebook). Integrates with
auth_sdkfor seamless login flow via the multi-impl pattern.
Version: 1.0.0
Variables
| Variable | Type | Default | Description |
|---|---|---|---|
| includeGoogle | boolean | true | Generate google_social_auth_impl (Google Sign-In) |
| includeApple | boolean | true | Generate apple_social_auth_impl (required by App Store when any other provider is enabled) |
| includeFacebook | boolean | false | Generate facebook_social_auth_impl (Facebook Login) |
Generated Packages
| Package | Condition | Description |
|---|---|---|
social_auth_api | Always | Contract + shared models (no plugin deps) |
social_auth_impl | Always | Orchestrator integrating with AuthSDK |
google_social_auth_impl | includeGoogle | Google Sign-In handler |
apple_social_auth_impl | includeApple | Sign in with Apple handler |
facebook_social_auth_impl | includeFacebook | Facebook Login handler |
Usage
Interactive
bash
archipelago generate social_auth_sdkNon-interactive (CI)
bash
archipelago generate social_auth_sdk --config my_config.jsonGenerated Structure
features/
└── social_auth/
├── social_auth_api/
│ └── lib/src/
│ └── models/
├── social_auth_impl/
│ └── lib/src/
│ └── di/
├── google_social_auth_impl/ # if includeGoogle
│ └── lib/src/
│ └── di/
├── apple_social_auth_impl/ # if includeApple
│ └── lib/src/
│ └── di/
└── facebook_social_auth_impl/ # if includeFacebook
└── lib/src/
└── di/DI Wiring
The post-gen hook wires everything automatically into apps/template_app/lib/di/injector.dart and apps/template_app/pubspec.yaml:
- Each enabled provider's
*PackageModuleis added toexternalPackageModulesBeforefirst. SocialAuthImplGlobalModule(the orchestrator) is added last sogetIt.getAll<SocialAuthProviderHandler>()resolves all handlers correctly.- Disabled providers are stripped from both the injector and pubspec.
No manual DI edits are required after generation.
Post-Install Steps
Google Sign-In
- Add your OAuth 2.0 client ID to
android/app/build.gradle(resValue) and iOSInfo.plist(CFBundleURLSchemes). - See: https://pub.dev/packages/google_sign_in
Sign in with Apple
- Enable the Sign in with Apple capability in Xcode.
- Configure an Apple Services ID for web/Android redirect.
- See: https://pub.dev/packages/sign_in_with_apple
Facebook Login
- Add your App ID and Client Token to
android/app/res/values/strings.xmland iOSInfo.plist. - See: https://pub.dev/packages/flutter_facebook_auth
App Store Policy
Apple requires that any app offering third-party social login (Google, Facebook) also offers Sign in with Apple. Disabling includeApple while enabling other providers triggers a pre-gen warning at generation time.