import { createAuthClient } from "@tailor-platform/app-shell";

const appUri = import.meta.env.VITE_TAILOR_APP_URL as string | undefined;
const clientId = import.meta.env.VITE_TAILOR_CLIENT_ID as string | undefined;

if (!appUri) {
  throw new Error("VITE_TAILOR_APP_URL must be set");
}

if (!clientId) {
  throw new Error("VITE_TAILOR_CLIENT_ID must be set");
}

export const authClient = createAuthClient({
  appUri,
  clientId,
});
