Options
All
  • Public
  • Public/Protected
  • All
Menu

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.

Hierarchy

Index

Constructors

Methods

  • Allows you to change the user's password by sending an OTP.

    Parameters

    Returns Promise<ResponseSdk<ChangePasswordResponse>>

     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.

    Returns Promise<ResponseSdk<CreateGuestTokenRequest>>

     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.

    Parameters

    Returns Promise<ResponseSdk<CreateUserResponse>>

    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

    Parameters

    Returns Promise<ResponseSdk<Response200>>

    const { data, error } = await checkout.editUser({
    email: `email@gmail.com`,
    first_name: 'John',
    last_name: 'Doe',
    phone: '+34333',
    identity_document: '1-1',
    })
  • getDeviceId(sessionId: string): Promise<ResponseSdk<string>>
  • Parameters

    • sessionId: string

    Returns Promise<ResponseSdk<string>>

     const {data, error} = await checkout.getDeviceId("sessionId")
    
  • It is used to obtain user data.

    Returns Promise<ResponseSdk<User>>

     const {data, error} = await checkout.getUser()
    
  • It is used to log in with the fingerprint of the device.

    Returns Promise<ResponseSdk<CreateGuestTokenRequest>>

     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.

    Parameters

    • email: string
    • password: string

    Returns Promise<ResponseSdk<CreateGuestTokenRequest>>

     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.

    Parameters

    • email: string
    • otpCode: string
    • otpType: OtpType

    Returns Promise<ResponseSdk<CreateGuestTokenRequest>>

    // 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.

    Returns Promise<ResponseSdk<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.

    Parameters

    • email: string

    Returns Promise<ResponseSdk<Response200>>

     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.

    Parameters

    • email: string

    Returns Promise<ResponseSdk<Response200>>

     const {data, error} = await checkout.sendOtpToSMS("jhonDoe@yourmail.com")
    
  • It is used to disconnect the user session.

    Returns Promise<ResponseSdk<Response200>>

     const {data, error} = await checkout.signOut()
    
  • It is used to check if a user already exists.

    Parameters

    • email: string

    Returns Promise<ResponseSdk<Response200>>

     const {data, error} = await checkout.checkIfUserExists("jhonDoe@yourmail.com")
    

Generated using TypeDoc