import { Account, Client, ID } from "appwrite" import { toast } from "react-toastify" const client = new Client() client.setProject(import.meta.env.VUE_APPWRITE_PROJECT_ID) export async function register(opts: { email: string; password: string }, errText: string) { const account = new Account(client) try { await account.create(ID.unique(), opts.email, opts.password) } catch (error: any) { toast.error(error?.message ?? errText) return Promise.reject(error) } }