import { Client, Account } from "appwrite";

const client = new Client();
client
  .setEndpoint(process.env.NEXT_PUBLIC_APPWRITE_ENDPOINT)
  .setProject(process.env.NEXT_PUBLIC_APPWRITE_PROJECT_ID);

const account = new Account(client);
console.log("Endpoint:", process.env.NEXT_PUBLIC_APPWRITE_ENDPOINT);
console.log("Project ID:", process.env.NEXT_PUBLIC_APPWRITE_PROJECT_ID);

if (!process.env.NEXT_PUBLIC_APPWRITE_ENDPOINT || !process.env.NEXT_PUBLIC_APPWRITE_PROJECT_ID) {
  throw new Error("Appwrite environment variables are not set properly.");
}


export { account,client };
