This code example shows how to add the Vouched JS Plugin to a React app. It was bootstrapped with Create React App using npx create-react-app <app-name> --template typescript but will also work for projects created with npx create-react-app <app-name>. There are 2 main files, src/vouched-script.js for loading our script, and src/App.tsx for our React component.
Fill in appId in src/vouched-script.js with your Public Key. To obtain one, create a Vouched account and generate a key from your Vouched dashboard.
Next, run npm install, followed by npm start. Go to http://localhost:3000 and you should see the plugin loaded. You can inspect the console to see provided messages as you progress through the verification process.
You can learn more about the Vouched JS Plugin here.
You can learn more in the Create React App documentation.
To learn React, check out the React documentation.