diff --git a/src/lib/appwrite.ts b/src/lib/appwrite.ts new file mode 100644 index 0000000..2a3e99e --- /dev/null +++ b/src/lib/appwrite.ts @@ -0,0 +1,14 @@ +import { Account, Client } from "node-appwrite"; + +export async function createAdminClient() { + const client = new Client() + .setEndpoint(process.env.NEXT_PUBLIC_APPWRITE_ENDPOINT!) + .setProject(process.env.NEXT_PUBLIC_APPWRITE_PROJECT!) + .setKey(process.env.NEXT_APPWRITE_KEY!); + + return { + get account() { + return new Account(client); + }, + }; +}