Giter Site home page Giter Site logo

clay-sdk's Introduction

Clay.io SDK

Clay.io SDK

Install

Add to the top of <body>

<script>
(function(C,l,a,y,_,i,o){C[_]=C[_]||function(){
(C[_].q=C[_].q||[]).push(arguments)},C[_].l=1*new Date();i=l.createElement(a),
o=l.getElementsByTagName(a)[0];i.async=1;i.src=y;o.parentNode.insertBefore(i,o)
})(window,document,'script','//cdn.wtf/sdk/v1/clay_sdk.js','Clay');

Clay('init', {gameId: 0000})
</script>

Example

Clay('init', {gameId: 0000})

Clay('client.share.any', {text: 'Come play a game with me!'})

Clay('ui.ads.banner', {position: 'top'}, function (err, ad) {
  document.body.appendChild(ad.$el)
})

Usage

Init
Clay('init', {gameId: 0000})
Full Page Ads
Clay('ui.ads.page', function (err, ad) {
  document.body.appendChild(ad.$el)
})
Banner Ads

position: top|bottom

Clay('ui.ads.banner', {position: 'top'}, function (err, ad) {
  document.body.appendChild(ad.$el)
})
Share Any

Share a message using the best available option.
For example, if called from within the Clay.io Android application the native share modal will appear.
Otherwise, other services such as twitter will be used.

Clay('client.share.any', {text: 'Hello World'})
Version
Clay('version', function (err, version) {
  console.log(version);
})

Contributing

Install pre-commit hook

ln -s ../../pre-commit.sh .git/hooks/pre-commit

npm install
npm test

clay-sdk's People

Contributors

zolmeister avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.