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

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

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 };
