import { createAuthClient } from "better-auth/client";

import {
    inferAdditionalFields,
    usernameClient,
    adminClient,
    apiKeyClient,
} from "better-auth/client/plugins";
import type { auth } from "./auth.js";

export const authClient = createAuthClient({
    baseURL: process.env.BETTER_AUTH_URL,
    plugins: [
        inferAdditionalFields<typeof auth>(),
        usernameClient(),
        adminClient(),
        apiKeyClient(),
    ],
});
