Web Plugin

Version:- 1.0.7

Step 1: Include Flyy SDK in your Web Application

<script type="text/javascript" src="https://cdn.theflyy.com/web-assets/flyy_sdk_package/v1.0.7/flyy-sdk.js" defer></script>

Step 2: Start Referral Tracking in your Web Application for Non-logged in users (for Acquisition module)

This should be called as soon as the Web Application is loaded.

 window.onload = function(){
   var flyySDK = new FlyySDK();
   flyySDK.startReferralTracking();
 }

Step 3: Setup a server-to-server API Call to fetch ext_user_token for each user

Use the API documentation - https://api-docs.theflyy.com/

Step 4: Initialize the SDK for a Logged-in/Signed Up User

<script type="text/javascript">
  (function () {
    var data = {
      package_name: "<package-name> input in the dashboard",
      partner_id: "<PARTNER_ID>",
      ext_user_token: "<token for an ext_user_id from flyy partner API>",
      device_id: “<device id received from flyy partner API”
      environment: “STAGE/PRODUCTION”
    };
  window.onload = function(){
    var flyySDK = new FlyySDK();
    flyySDK.initSDK(JSON.stringify(data));
  }
  })();
</script>

Step 5: Send User Events

Send User Events using Server-to-Sever setup using User Events API. https://api-docs.theflyy.com

Custom Button

You can pass your own element ID which will toggle the visibility of the SDK popup.

flyySDK.initSDK(JSON.stringify(data), yourElementID);

Function to change “My Rewards” floating widget color

var flyySDK = new FlyySDK();
Var colorCode = “#FF0000”;
flyySDK.setActionButtonColor(colorCode);

Function to show Flyy Button

flyySDK.showFlyyButton()

Function to Hide Flyy Button

flyySDK.hideFlyyButton()

Function to Set Position Of Flyy Button

flyySDK.setActionButtonPosition('left');

Function to Change the Color Of Flyy Button

flyySDK.setActionButtonColor('#faa232');

Function to Change the Text Of Flyy Button

flyySDK.setActionButtonText('<Enter the button name>');