login()
.createGuestAccount
function from the useGuestAccounts
hook in the React SDK to integrate guest accounts. The createGuestAccount
function returns an authenticated User
object.createGuestAccount
is an asynchronous call that will create and authenticate users as guests. If the user is already a guest, this call is idempotent. If the user is already logged in as a non-guest user, this will throw an error indicating as such.isGuest
property on the User
object returned by the usePrivy
hook.usePrivy
hook.wallets
array. All embedded wallet functionality that is available for logged-in users is also available to guest users.login()
to enable the guest user to upgrade their account to a logged-in account using any authentication method of their choice.logout()
to enable the guest user to delete their guest session. This is an important interface to support so that users who start a guest session but would prefer to log in with a pre-existing account, are able to do so.