Direct Integration
TipTop-JS reference
Overview

TipTop-JS Reference

tiptop.js

To integrate TipTop functionality into your store, add the following loader script within the head section of your global page template. This script will asynchronously load the necessary TipTop JavaScript library without blocking the loading of other elements on your page.

The lightweight tiptop.js library is responsible for rendering promotional messages as well as launching the TipTop payments experience.

As part of the TipTop Partner onboarding process you'll be granted both test and production keys. When you're ready to accept live transactions, replace the test key with your production key.

You can find your public API keys in the TipTop Partner Dashboard (opens in a new tab).

tiptop.js
<script>
  var _tiptop_config = {
    public_api_key: "YOUR_PUBLIC_API_KEY",
    script: "https://cdn.tiptop.com/js/v1/tiptop.js",
  };
 
  !(function (t, e) {
    var n = t.tiptop || {},
      c = document.createElement("script");
    (c.async = !0), (c.src = e.script);
    var i = document.getElementsByTagName("script")[0];
    i.parentNode?.insertBefore(c, i), (t.tiptop = n);
  })(window, _tiptop_config);
</script>

Ready

A callback function can be attached to tiptop.ui.ready(). This function will be triggered once the tiptop.js script has finished loading completely.

JavaScript
tiptop.ui.ready(function () {
  console.log("TipTop JS ready!");
});