Skip to content

Proposal: opt-in GitHub sign-in addon with a mock OAuth provider for dev and tests (Mockatoo) #1305

Open

Description

@tianhuil

Would you accept an opt-in --addons mockatoo that adds GitHub sign-in to the Better Auth template, using a mock provider outside production? If yes, I'll open a PR. If not, no hard feelings.

Disclosure: I build Mockatoo, a free hosted mock OAuth provider. Its connector, @mockatoo/connect-better-auth, is a thin wrapper around Better Auth's own GitHub provider.

Why

The Better Auth template is email/password only today. Adding social sign-in usually means registering a GitHub OAuth app before the first dev run, and E2E tests can't sign in through real GitHub. With the addon:

  • Development and tests: sign-in goes through Mockatoo. No OAuth app or secrets needed; tests sign in with a Mockatoo test account.
  • Production: unchanged. Better Auth's normal GitHub provider, and the Mockatoo plugin isn't loaded.

What the demo branch does

Branch: https://github.com/mockatoo/create-better-t-stack/tree/mockatoo-dev-auth

 // server auth template (only with --addons mockatoo)
+socialProviders: isProduction ? { github } : {},
+plugins: isProduction ? [...] : [mockGitHub(github), ...],

 // Next.js sign-in form
+<Button>Continue with GitHub</Button>
  • --addons mockatoo is opt-in. Defaults don't change.
  • GitHub env vars are @required=forEnv(production) in the Varlock schema.
  • Scope: Next.js frontend, Better Auth, non-Convex backends. Convex, native and other frontends are not covered.
  • Checks: bun run check, bun run build:cli and the CLI tests pass (with --timeout 30000; at the default 5s, one test times out on main too). In production mode, sign-in redirects to github.com.

Setup, for anyone trying the branch

  1. Scaffold with --frontend next --auth better-auth --addons mockatoo.
  2. Sign up at https://app.mockatoo.globalunderdog.com/signup. The dashboard shows a test email and password. Docs: https://mockatoo.globalunderdog.com/docs

Activity

  1. tianhuil commented on Nov 13, 2026

    @tianhuil
    Author

    PR is up: #1306 (branch mockatoo-dev-auth, 4 commits).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions