Setting up Playroom Kit
💡
Note: These methods may not apply to all engines (such as Godot (opens in a new tab) or Unity (opens in a new tab)). Please refer to the respective page for engine setup for explicit use.
Using NPM
If you are using npm, install Playroom Kit and its peer dependencies:
npm install --save playroomkit react react-domThen import it into your project:
import { onPlayerJoin, insertCoin, isHost, myPlayer } from "playroomkit";Using a CDN
You can also directly include it via a script tag from a CDN like unpkg.com or our own cdn.joinplayroom.com, make sure to also include the peer dependencies also (react, react-dom):
<body>
<script src="https://unpkg.com/playroomkit/multiplayer.full.umd.js" crossorigin="anonymous"></script>
<script>
#Do what you want
Playroom.doSomething()
</script>
</body>This example imports the Playroom scope which can be used by your game.
Next Steps
Refer to Usage for your engine of choice.