Use the composable useSignInAnonymous to sign in a user anonymously.

As a result, the user will have the anonymous role and subsequent set of permissions. The user can then be converted to a regular user at a later stage using email+password sign-up, passwordless email (magic link), or passwordless SMS.

const { signInAnonymous, isLoading, isSuccess, isError, error } =
  useSignInAnonymous()

watchEffect(() => {
  console.log(isLoading.value, isSuccess.value, isError.value, error.value)
})

const handleFormSubmit = async (e) => {
  e.preventDefault()

  await signInAnonymous()
}