Skip to content
Türkçe

Introducing Magic Social Auth 1.0.2

Social sign-in through a single facade.

Native Google sign-in on iOS and Android, native Apple on iOS, and a backend-hosted browser flow for GitHub, Microsoft and the rest, on iOS, Android and web. Ready-made SocialAuthButtons included.

Runs on

  • Android
  • iOS
  • Web

One facade. Four providers.

Google, Apple, GitHub and Microsoft on iOS, Android and web, behind a single SocialAuth facade. It is the client of the magic-starter-laravel social login, so that backend is required.

One facade API

SocialAuth.driver(name).signIn() signs in, SocialAuth.supports(name) checks a provider and SocialAuth.signOut() signs out. Laravel Socialite users will know the shape.

  • supports(name) answers false for a disabled or unknown provider, never throws
  • The package never creates a session: signIn() answers a SocialAuthResult
Read the docs

Native sheets

Google is native on iOS and Android through google_sign_in, Apple on iOS through sign_in_with_apple. Apple on Android and web uses the browser flow.

  • Native flows post the SDK's ID token to auth/social/{provider}/token
  • Google with no server_client_id fails as sdk_error, and the log names the key
Read the docs

Browser flow with PKCE

GitHub and Microsoft use it on every platform, and Google on web. The backend hosts it; on web a popup page (auth.html) posts the result back.

  • The app mints a PKCE pair and trades the code at auth/social/exchange
  • iOS returns by custom scheme, Android by https App Link, web by popup and auth.html
Read the docs

Connect and confirm

For accounts a signed-in user links, the driver contract offers beginConnect, connect and confirm.

  • confirm() answers a single-use confirmationToken for a password-less account
  • beginConnect is the web variant: a popup opened after an await is blocked
Read the docs
Future<void> link(String password) async {
  // Mobile: one call.
  await SocialAuth.driver('github').connect({'password': password});
}

Setup by command line

social:install does the native setup and social:doctor checks it and prints the backend .env lines.

  • social:doctor prints the callback URL each provider console has to list
  • social:install --dry-run previews; a changed file is a conflict until --force
Read the docs

Custom drivers

Register your own with SocialAuth.manager.extend(name, factory); a driver implements the SocialDriver contract.

  • Register before the first SocialAuth.driver('gitlab') call
  • The backend must host the flow; the app only carries the PKCE pair
Read the docs
SocialAuth.manager.extend(
  'gitlab',
  (config) => RedirectDriver('gitlab', config),
);
platforms
3
commands to install
2
license
MIT

Your agent speaks Magic Social Auth.

The Magic Social Auth skill teaches your coding assistant how to wire SocialAuth sign-in, finish the session with Auth.login and keep the callbacks in step with the backend before the first line. One command wires it up.

npx skills add anilcancakir/ai --skill magic-social-auth

run in your project other editors

works with

  • Claude Code
  • Cursor
  • OpenCode
  • VS Code Copilot
  • Codex CLI

And checks the docs.

Skills teach the API. The MCP server at mcp.anilcancakir.com/magic_social_auth gives your agent live docs lookup while it edits, so it never guesses a signature.

  • Streamable HTTP

    One endpoint, every client.

  • search-docs

    Live query against the source.

  • Public, no auth

    Read-only, free to use.

Connect your editor
mcp.anilcancakir.com/magic_social_auth preview

# streamable http, the default

claude mcp add --transport http magic_social_auth https://mcp.anilcancakir.com/magic_social_auth

# or stdio, for clients without http

npx -y mcp-remote https://mcp.anilcancakir.com/magic_social_auth

Public, no auth.

Questions, answered.

What people ask before they add Magic Social Auth to a Flutter app.

What is Magic Social Auth?

Magic Social Auth is the social sign-in plugin for Magic apps. The SocialAuth facade signs users in with Google, Apple, GitHub and Microsoft through native sheets or a PKCE browser flow, and your magic-starter-laravel backend decides the outcome.

How do I install Magic Social Auth?

Run flutter pub add magic_social_auth, then dart run magic:dowel plugin:install magic_social_auth and dart run magic:dowel social:install. dart run magic:dowel social:doctor checks the result and prints the backend .env lines.

Which platforms does Magic Social Auth support?

iOS, Android and web; macOS, Windows and Linux are not supported. Google is native on iOS and Android and a browser flow on web. Apple is native on iOS only and uses the browser flow on Android and web. GitHub and Microsoft always use the browser flow.

What backend does Magic Social Auth need?

A magic-starter-laravel backend with the social-login feature on. It hosts the browser flow, and client secrets and the Apple key live there, never in the app.

Does Magic Social Auth create the session?

No. The package never logs the app in: a driver answers a SocialAuthResult and you run Auth.login. With magic_starter, the bridge that social:install publishes hands the result to the starter's login.

Does Magic Social Auth work with AI coding agents?

Yes. Magic Social Auth ships an agent skill that teaches your assistant how to wire SocialAuth sign-in, finish the session with Auth.login and keep the callbacks in step with the backend, plus a public docs MCP server for live lookup.

Is Magic Social Auth open source?

Yes. Magic Social Auth is open source under the MIT license.

Add it in seconds

~/my_app
flutter pub add magic_social_auth

Or add to pubspec.yaml:

dependencies:
  magic_social_auth: ^1.0.2

Or give your AI agent this prompt:

Read https://anilcancakir.com/magic/docs/social_auth/llms.txt and install the Magic Social Auth package in this project.