fk-games-sdk
TypeScript icon, indicating that this package has built-in type declarations

0.0.1-alpha.34 • Public • Published

Flipkart Games SDK

Installation

  • Install fk-games-sdk into your npm project. You can use the following command and run it in your terminal at the project root.
npm install fk-games-sdk
  • You could also use fk-games-sdk by directly including the script into your html file.
http://img1a.flixcart.com/linchpin-web/batman-returns/build/fk-game-sdk@0.0.1-alpha.27.js
  • Minified and GZipped script
http://img1a.flixcart.com/linchpin-web/batman-returns/build/fk-game-sdk-min@0.0.1-alpha.27.js

You could replace version numbers in the script tag with the latest npm version if the README isn't up to date.

Initialize using NPM

// NPM only : import will make sure we create FKExtension on the window object to give clients a way to create new platform instance and access modules
import * as GamesSDK from  "fk-games-sdk";
// NOTE - please refrain from calling any module before the DOMContentLoaded callback
window.addEventListener('DOMContentLoaded'function() {
    const fkPlatform = FKExtension.newPlatformInstance();
    fkPlatform.getModuleHelper().getAnalyticsModule().sendGameAnalyticsEvent({
            gameName: 'bestGame'
            campaignId?'abc-zyx';
            energyPoints?: 300;
            league?'gold';
            badgesCount?: 2;
            friendCount?: 150;
            position?: 4;
            transactions?: ['power''time'];
            rewards?: ['first''second'];
            powers?: ['strength'];
            deathCount?: 3;
            livesLeft?: 2;
            actionType: GameActionType.SHARE;
        }
    ).then((data) => {
        // Do something based on data
    });
});

Usage

fk-games-sdk is a set of modules that help client use Flipkart functionalities for easy game development. All modules are promisified.

goBack()
navigate(action)
sendGameAnalyticsEvent(gameEventData)
getCurrentTime()
  • ShareModule - fkPlatform.getModuleHelper().getShareModule()
share(url, title)
resolveImage(url, width, height, quality)
  • AssetsModule - fkPlatform.getModuleHelper().getAssetsModule()
getAssetMap(themeId)
setStatusBarColor(color)
disableFlyout()
enableFlyout()

Package Sidebar

Install

npm i fk-games-sdk

Weekly Downloads

0

Version

0.0.1-alpha.34

License

Apache-2.0

Unpacked Size

117 kB

Total Files

107

Last publish

Collaborators

  • muskeinsingh