Vouch logoVouch documentation
Getting started

Handling inputs

Some vouch datasources require additional context or constraints for verification. These parameters are called inputs and are passed as a JSON object in the inputs query parameter.

Each data source has its own unique set of inputs. Which parameters you need to provide depends entirely on which data source you're using. Check the Available Data Sources documentation to see the specific inputs required for each data source.

Example: Verifying Twitter Following

To verify that a user follows a specific Twitter account, you use the "X - Following" data source (1cb27231-a559-4f19-8929-463ed90446dd), which requires the twitter_username input parameter.

// Get the Twitter username from user input
const twitterUsername = prompt("Enter the Twitter username you want to verify following:");

const requestId = crypto.randomUUID();
const params = new URLSearchParams({
  requestId,                                 // Unique ID for this verification
  datasourceId: "1cb27231-a559-4f19-8929-463ed90446dd", // X - Following data source
  customerId: "1be03be8-5014-413c-835a-feddf4020da2",   
  inputs: JSON.stringify({ twitter_username: zkmarek}), // User-specified Twitter handle
  redirectBackUrl:
    `https://docs.getvouch.io/getting-started/handling-inputs?requestId=${requestId}`, // return back after verification
  webhookUrl: `https://docs.getvouch.io/api/web-proof/${requestId}` // (Optional) POST web proof here
});

// Redirect the user to vouch with the constructed query string
window.location.href = `https://app.getvouch.io/start?${params.toString()}`;

Enter the Twitter handle you want to verify following (without @)