1 | ## Clay.io SDK Base
|
2 |
|
3 | Clay.io SDK Base is a subset of the [Clay.io SDK](https://github.com/claydotio/clay-sdk)
|
4 |
|
5 | ### Install
|
6 |
|
7 | Add 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),
|
13 | o=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 |
|
16 | Clay('init', {gameId: 0000})
|
17 | </script>
|
18 | ```
|
19 |
|
20 | ### Example
|
21 |
|
22 | ```js
|
23 | Clay('init', {gameId: 0000})
|
24 |
|
25 | Clay('client.share.any', {text: 'Come play a game with me!'})
|
26 | ```
|
27 |
|
28 | ### Usage
|
29 |
|
30 | ##### Init
|
31 |
|
32 | ```js
|
33 | Clay('init', {gameId: 0000})
|
34 | ```
|
35 |
|
36 | ##### Share Any
|
37 |
|
38 | Share a message using the best available option.
|
39 | See [Clay.io SDK](https://github.com/claydotio/clay-sdk) docs for details.
|
40 |
|
41 | ```js
|
42 | Clay('client.share.any', {text: 'Hello World'})
|
43 | ```
|
44 |
|
45 | ##### Version
|
46 |
|
47 | ```js
|
48 | Clay('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
|
60 | npm install
|
61 | npm test
|
62 | ```
|