The SDK

Before loading any widget from TheNextBid into your website it is required to first load the JavaScript SDK of TheNextBid. This is something which only has to be done once.

The JavaScript SDK of TheNextBid for JavaScript doesn't have any standalone files that need to be downloaded or installed, instead you simply need to include a short piece of regular JavaScript in your HTML that will asynchronously load the SDK. The async load means that it does not block loading other elements of your page.

The following snippet of code will provide the SDK. You should insert it directly after the opening <body> tag on each page you want to load it:

<script>
  (function(d, w, s, id){
    if (d.getElementById(id)) {return;}
    w.TNB = function(){w.TNB.calls.push(arguments)}; w.TNB.calls = [];
    var js, x = d.getElementsByTagName(s)[0];
    js = d.createElement(s); js.id = id; js.async = true;
    js.src = 'https://thenextbid.com/sdk-v.1.0.js'
    x.parentNode.insertBefore(js, x);
  }(document, window, 'script', 'thenextbid-jssdk'));
</script>

Once you copied this code you will be ready to add the actual widget to your website! Go to the next page to find out how!

Last updated