Google Sign-In Not Working with `authClient.signIn.social()`

I'm implementing Google authentication using better-auth with React. Here's my setup:

  1. Client-side auth client:
    import { createAuthClient } from "better-auth/react";
    export const authClient = createAuthClient({
    baseURL: "http://localhost:5173",
    });
  2. Server-side auth configuration:
import { betterAuth } from "better-auth";
import { drizzleAdapter } from "better-auth/adapters/drizzle";

export const auth = betterAuth({
  socialProviders: {
    google: {
      clientId: process.env.GOOGLE_CLIENT_ID,
      clientSecret: process.env.GOOGLE_CLIENT_SECRET,
    },
  },
  database: drizzleAdapter(db, {
    provider: "sqlite",
  }),
});



  1. Sign-in component:
<button
  onClick={async () =>
    await authClient.signIn.social({
      provider: "google",
      callbackURL: "/dashboard",
      errorCallbackURL: "/error",
      disableRedirect: true,
    })
  }
>
  continue with google
</button>


Issue:
When I click the sign-in button, nothing seems to happen. I've configured my Google OAuth credentials and environment variables, but the authentication flow isn't starting.

Questions:
Am I missing any configuration steps?
Is there a way to debug the authentication flow?
Should I be handling the response from authClient.signIn.social() differently?

Environment:
better-auth (latest version)
React
TypeScript
React Router
Was this page helpful?