Skip to content

social_auth_sdk Pro

Social authentication feature SDK with per-provider packages (Google, Apple, Facebook). Integrates with auth_sdk for seamless login flow via the multi-impl pattern.

Version: 1.0.0

Variables

VariableTypeDefaultDescription
includeGooglebooleantrueGenerate google_social_auth_impl (Google Sign-In)
includeApplebooleantrueGenerate apple_social_auth_impl (required by App Store when any other provider is enabled)
includeFacebookbooleanfalseGenerate facebook_social_auth_impl (Facebook Login)

Generated Packages

PackageConditionDescription
social_auth_apiAlwaysContract + shared models (no plugin deps)
social_auth_implAlwaysOrchestrator integrating with AuthSDK
google_social_auth_implincludeGoogleGoogle Sign-In handler
apple_social_auth_implincludeAppleSign in with Apple handler
facebook_social_auth_implincludeFacebookFacebook Login handler

Usage

Interactive

bash
archipelago generate social_auth_sdk

Non-interactive (CI)

bash
archipelago generate social_auth_sdk --config my_config.json

Generated 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:

  1. Each enabled provider's *PackageModule is added to externalPackageModulesBefore first.
  2. SocialAuthImplGlobalModule (the orchestrator) is added last so getIt.getAll<SocialAuthProviderHandler>() resolves all handlers correctly.
  3. Disabled providers are stripped from both the injector and pubspec.

No manual DI edits are required after generation.

Post-Install Steps

Google Sign-In

  1. Add your OAuth 2.0 client ID to android/app/build.gradle (resValue) and iOS Info.plist (CFBundleURLSchemes).
  2. See: https://pub.dev/packages/google_sign_in

Sign in with Apple

  1. Enable the Sign in with Apple capability in Xcode.
  2. Configure an Apple Services ID for web/Android redirect.
  3. See: https://pub.dev/packages/sign_in_with_apple

Facebook Login

  1. Add your App ID and Client Token to android/app/res/values/strings.xml and iOS Info.plist.
  2. 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.

Built by Banua Coder