UNPKG

1.1 kBMarkdownView Raw
1## Clay.io SDK Base
2
3Clay.io SDK Base is a subset of the [Clay.io SDK](https://github.com/claydotio/clay-sdk)
4
5### Install
6
7Add to the top of `<body>`
8
9```html
10<script>
11(function(C,l,a,y,_,i,o){C[_]=C[_]||function(){
12(C[_].q=C[_].q||[]).push(arguments)},C[_].l=1*new Date();i=l.createElement(a),
13o=l.getElementsByTagName(a)[0];i.async=1;i.src=y;o.parentNode.insertBefore(i,o)
14})(window,document,'script','//cdn.wtf/sdk/v1/clay_sdk_base.js','Clay');
15
16Clay('init', {gameId: 0000})
17</script>
18```
19
20### Example
21
22```js
23Clay('init', {gameId: 0000})
24
25Clay('client.share.any', {text: 'Come play a game with me!'})
26```
27
28### Usage
29
30##### Init
31
32```js
33Clay('init', {gameId: 0000})
34```
35
36##### Share Any
37
38Share a message using the best available option.
39See [Clay.io SDK](https://github.com/claydotio/clay-sdk) docs for details.
40
41```js
42Clay('client.share.any', {text: 'Hello World'})
43```
44
45##### Version
46
47```js
48Clay('version', function (err, version) {
49 console.log(version);
50})
51```
52
53### Contributing
54
55##### Install pre-commit hook
56
57`ln -s ../../pre-commit.sh .git/hooks/pre-commit`
58
59```bash
60npm install
61npm test
62```