deleteUser lets you delete the logged in user and all its data. This API will return a promise that gets resolved once the user gets marked for deletion. It will also cancel a user's subscription if set, and automatically invalidate the user's session and log out the user. The user's data will be purged from Userbase after 30 days.
userbase.deleteUser().then(() => {
// user marked for deletion
}).catch((e) => console.error(e))