0.12.0 • Published 2 years ago

@tentuplay/js-client-sdk v0.12.0

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

Installation and Usage

HTML

<script src="<script_url>"></script>
<script>
    const clientKey = "<client_key>";
    const t = new TentuPlay({ clientKey });
    t.onInit(() => {
      t.sendLogin({ playerSlug: "<player_slug>"})
    });
</script>

React

npm install @tentuplay/js-client-sdk
import { TentuPlay } from "@tentuplay/js-client-sdk";

function App() {
  const [SDK, setSDK] = useState(new TentuPlay({ clientKey: "<client_key>" }));

  function onLogin() {
    SDK.onInit(() => {
      SDK.sendLogin({ playerSlug: "<player_slug>" });
    })
  }

  return (
    // markup
  )
}

export default App;

For more details, see the docs.