No sooner you initialize the client you can send transaction using the next method.

You have to pass as entry parameters the Transaction ID and the User ID.

client
    .sendTransaction(transactionID, userID)

And that is all. Every time the method is called it will send a transaction.

Full example

The following code is a very simple example to test the SDK

(JavaScript file)

test.js

import { LBFraudSDK, LBFraudSDKEnvironment } from './ironchip.modern.js';

const client = new LBFraudSDK({
  apiKey: 'api-key',
  environment: LBFraudSDKEnvironment.Testing
});

const myButton = document.getElementById('myButton');

function setListener() {
  
  myButton.onclick = function(){
    const transactionID = document.getElementById('transactionId').value;
    const userID = document.getElementById('userId').value;
    client
    .sendTransaction(transactionID, userID)
    .then((success) => {console.log(success)})
    .catch((errorMsg) => {
      console.log(errorMsg)
      });
  }
}

window.onload=function(){
  setListener()
}

index.html

<!DOCTYPE html>
<html>
  <head>
    <title>Web SDK test</title>
  </head>
  <body>
    <label for="transactionId">Transaction ID:</label>
    <input type="text" id="transactionId" name="transactionId">
    
    <label for="userId">User ID:</label>
    <input type="text" id="userId" name="userId">
    
    <button id="myButton">Send transaction</button>
    
    <script type="module" src="test.js"></script>
  </body>
</html>