Allows you to change the user's password by sending an OTP.
const {data, error} = await checkout.changePassword({
email: "jhonDoe@yourmail.com",
otp: "123456",
password: "123456",
})
Generates a guest token when the user enters the checkout without being authenticated. This token can be used to connect the guest user with our services once the user decides to authenticate with their email.
const { data, error } = await checkout.createGuestToken()
Allows you to create a user to be part of the DEUNA network, thus being able to save addresses and credit cards.
const { data, error } = await checkout.createUser({
email: `email@gmail.com`,
first_name: 'John',
last_name: 'Doe',
phone: '+34333',
identity_document: '1-1',
});
Allows to edit the user information and it is always required to pass all the parameters
const { data, error } = await checkout.editUser({
email: `email@gmail.com`,
first_name: 'John',
last_name: 'Doe',
phone: '+34333',
identity_document: '1-1',
})
const {data, error} = await checkout.getDeviceId("sessionId")
It is used to obtain user data.
const {data, error} = await checkout.getUser()
It is used to log in with the fingerprint of the device.
const
{data, error} = await checkout.loginWithDeviceFingerprint()
It is used to authenticate you with your email and password. In order to log in with a password, it is required to ask the user to change their password.
const {data, error} = await checkout.loginWithEmailPassword("jhonDoe@yourmail.com","password")
It is used to authenticate with your mobile phone number via OTP. A One Time Password (OTP) is an automatically generated string of numeric or alphanumeric characters that authenticates a user for a single transaction or login session. This can be used by email or sms for this we will use the following methods.
// Mail authentication
const {data, error} = await checkout.sendOtpToEmail("jhonDoe@yourmail.com")
const {data, error} = await checkout.loginWithOtp("jhonDoe@yourmail.com","password", OtpType.Email)
// SMS authentication
const {data, error} = await checkout.sendOtpToSMS("jhonDoe@yourmail.com")
const {data, error} = await checkout.loginWithOtp("jhonDoe@yourmail.com","password", OtpType.Sms)
It is used to retrieve the state of the user.
const {data, error} = await checkout.refetchUser()
It requests an OTP (one-time-password) and sends it to the user's email to authenticate them. It is used for login and user password change.
const {data, error} = await checkout.sendOtpToEmail("jhonDoe@yourmail.com")
It requests an OTP (one-time password) and sends it via SMS to the user's phone to authenticate them. It is used to login and change the user password.
const {data, error} = await checkout.sendOtpToSMS("jhonDoe@yourmail.com")
It is used to disconnect the user session.
const {data, error} = await checkout.signOut()
It is used to check if a user already exists.
const {data, error} = await checkout.checkIfUserExists("jhonDoe@yourmail.com")
Generated using TypeDoc
Will allow us to perform user authentication and actions with different methods, including the way to enter the Deuna network as a guest, to be able to authenticate with email, to be able to authenticate by SMS(OTP), to be able to create a user, to be able to edit a user and make password changes.