Tyro.js
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.
Including Tyro.js
- 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.js
rather than included in a bundle or hosted yourself.
Implementation
<!-- HTML sample code -->
<script src="https://pay.connect.tyro.com/v1/tyro.js"></script>
Instantiate Tyro.js
- 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.
Config Parameters
liveMode required | boolean Toggles between the live and sandbox environment. Defaults to false. |
Implementation
// Javascript sample code
const tyro = Tyro({
liveMode: false
});