import { createAuthClient } from "better-auth/react"
import { usernameClient } from "better-auth/client/plugins"

/**
 * The browser half. `usernameClient` is what puts `signIn.username()` on this
 * object; without it the client would only know how to sign in by email, which
 * is the one thing nobody here can do.
 */
export const authClient = createAuthClient({
  plugins: [usernameClient()],
})

export const { signIn, signOut, useSession } = authClient
