Tyro.js is a public Javascript library provided by Tyro. It provides a simple interface to enable integration with the Pay API from your frontend code.
- Include the Tyro.js script on the checkout page of your HTTPS website.
- For PCI Compliance, Tyro.js should always be loaded directly from
https://pay.connect.tyro.com/v1/tyro.jsrather than included in a bundle or hosted yourself.
<!-- HTML sample code -->
<script src="https://pay.connect.tyro.com/v1/tyro.js"></script>- After adding the Tyro.js script tag in the header, we need to instantiate it.
- Use
Tyro(config)to create an instance of the Tyro.js object. The Tyro.js object is the entrypoint to the rest of the methods of Tyro.js.
liveModebooleanrequired
Toggles between the live and sandbox environment. Defaults to false.
// Javascript sample code
const tyro = Tyro({
liveMode: false
});