Skip to content

Installation

Add the SDK script to your website's <head> section:

html
<script src="https://s3.us-east-2.amazonaws.com/cdn.rentmy.co/affiliate/prod/affiliate-sdk.min.js"></script>

init()

Initialize the SDK with your API key. Must be called first.

javascript
await new Promise(function (resolve) {
  if (window.AffiliateSDK) return resolve();
  var interval = setInterval(function () {
    if (window.AffiliateSDK) {
      clearInterval(interval);
      resolve();
    }
  }, 50);
});

await window.AffiliateSDK.init({
  apiKey: "as_XXXXYYYYZZZZ",
  enablePageviews: true,
});

Released under the MIT License.