import cloudbase from "@cloudbase/js-sdk";

const tcb = cloudbase.init({
  env: "huihenduo-2gx127w7f837b584",
});

const auth = tcb.auth({
  persistence: "local",
});

async function AnonymousLogin() {
  return new Promise(async (resolve, reject) => {
    let signIn = await auth.anonymousAuthProvider().signIn();
    const loginState = await auth.getLoginState();
    resolve();
  });
}

export { AnonymousLogin, tcb };
