How can I store user details into database for social providers?

I created a simple Hono + CF Workers app for me to try Better-Auth. Now I'm figuring out how can I store the user details into user table is it automatically handle by Better-Auth or do I need to use database hooks to achieve this? I'm using drizzle along with drizzleAdapter

auth.ts
import { betterAuth } from "better-auth";

import { neon } from "@neondatabase/serverless";

import { drizzle } from "drizzle-orm/neon-http";
import { drizzleAdapter } from "better-auth/adapters/drizzle";

import * as schema from "./database/schema";

export const createAuth = (
  env: CloudflareBindings
): ReturnType<typeof betterAuth> => {
  const psqlNeon = neon(env.DATABASE_URL);
  const db = drizzle(psqlNeon);

  return betterAuth({
    database: drizzleAdapter(db, {
      provider: "pg",
      schema: { ...schema },
      debugLogs: true
    }),
    socialProviders: {
      google: {
        clientId: env.GOOGLE_OAUTH_CLIENT_ID,
        clientSecret: env.GOOGLE_OAUTH_CLIENT_SECRET
      }
    }
  });
};

How I sign in my users
  const authClient = createAuthClient();

  async function signInWithGoogle() {
    await authClient.signIn.social({
      provider: "google"
    });
  }
Solution
Yup just a incorrect configuration lol. I was missing the baseUrl and secret in my configuration. Thanks @pavantamidala.
Was this page helpful?