How to integrate the Playable onto a website?

Embed your web game onto your website.

Integrating Playable (HTML/JavaScript)

  1. Add the Pley Playable SDK script to your <head>
<head>
	<script src="https://www.pley.com/playable/v1/sdk.js"></script>
	<!-- Other tags... -->
</head>
  1. Determine where to place the embed and give it an ID. In this example, it is called “pley-root”.
<body>
	<!-- Other elements... -->
	<div id="pley-root" />
</body>
  1. Get the release track ID from the Game Manager and create a new Playable instance in JavaScript.
new Pley.Playable({
	parent: document.getElementById("pley-root"),
	releaseTrackID: "RELEASE_TRACK_ID",
});

You can copy the release track ID from the Game manager under Integration in any release track.

Flags

There are also also optional flags you can include after the releaseTrackID. These will be disabled by default, which is what Pley recommends.

hideInfo (boolean): Hides button to show extra information, such as game descriptions and screenshots in the bottom bar of the screen.

autoplay (boolean): If true, the game will automatically start (bypassing the start and link account buttons). Generally, autostarting the game leads to fewer users playing the game. Should only be used on sites where another start button exists.

showConnectQR (boolean): Automatically displays the account linking QR code when the Playable opens.

new Pley.Playable({
	parent: document.getElementById("pley-root"),
	releaseTrackID: "RELEASE_TRACK_ID",
  	hideInfo: false,
  	autoplay: false,
  	showConnectQR: false,
});