Direct Integration
TipTop-JS reference
Overview

TipTop-JS Reference

tiptop.js

Integrate TipTop seamlessly into your store! To get started, simply include the tiptop.js script within the head section of your global page template.

This script facilitates the creation of a TipTop instance. You'll need to provide your TipTop public API key and specify the environment you're working in (sandbox or production). The TipTop object acts as your gateway to all functionalities offered by the TipTop.js SDK.

Your TipTop public API key is essential for authentication purposes, allowing TipTop to recognize your website. Remember to switch from the sandbox key to your live key when your store is ready to accept real orders. The environment URL will also need to be updated accordingly.

tiptop.js
var _tiptop_config = {
    public_api_key: "YOUR_PUBLIC_API_KEY",
    script: "https://storage.googleapis.com/tiptop-core-stage/tiptop-js/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);

Method arguments

Required Method ArgumentTypeDescription
public_api_keystringYour public API key.
script (sandbox)stringsandbox: abc
script (production)stringproduction: abc

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!');
});