Skip to content

Game Replay

Overview

The Game Replay component plays back a won game round as the player played it, on the game's own board and at the pace of the original round. The viewer presses play to start the replay, can pause and mute it, and can watch it again once it ends.

Replays are available for won rounds of supported games. For any other round, the component shows a message instead of the replay.

Script URL

This web component is provided as a script and can be loaded from the CDN using the following URL pattern:

https://<cdn-url>/<bundle-version>/game-replay.js

Example:

https://cdn.example.com/v1.1.0/game-replay.js

Both <cdn-url> and <bundle-version> values will be provided to you.

If making use of the browser's Subresource Integrity feature, the integrity hash will also be provided.

Component Details

Once the script is loaded, the Game Replay component can be added to the page by using the element <gt-game-replay>.

Required Attributes

Attribute Type Description
roundId string The unique identifier of the game round to replay.

Optional Attributes

Attribute Type Description
locale string The locale code for content localization (e.g. en-US).
maxDurationMs number The longest the whole replay may take, in milliseconds, from pressing play to its end. A longer round is sped up to fit. Default: 30000.
settledDateUtc string The settlement date of the round in ISO 8601 UTC format (e.g. 2025-10-22T00:00:00.000Z).
showTiles boolean false hides the round's details (stake, payout and setup) shown under the replay. Default: true.
theme string The visual theme to apply (e.g. dark, light). Falls back to the default theme if invalid.

Example

<gt-game-replay 
  roundId="1234-5678-9012"
  settledDateUtc="2025-10-22T00:00:00.000Z"
></gt-game-replay>

Share page

A link shared from a game opens your share page, the shareUrl set on the Game Loader, with the round's ID as a roundId query parameter:

https://example.com/replays?roundId=0199f3c2-7a41-7c5e-9b2d-3e8f1a6c4d20

Your page uses that roundId twice:

  1. To play the round. Pass it to the component as its roundId attribute. The other attributes are optional.
  2. For the link's preview. Add it to the preview image URL, https://<share-image-host>/<roundId>, in the og:image tag. The <share-image-host> value will be provided to you.

For the link above, your server sends:

<!doctype html>
<html>
  <head>
    <meta property="og:title" content="<your title>" />
    <meta property="og:image" content="https://<share-image-host>/0199f3c2-7a41-7c5e-9b2d-3e8f1a6c4d20" />
    <meta property="og:image:width" content="1200" />
    <meta property="og:image:height" content="630" />
    <meta name="twitter:card" content="summary_large_image" />
    <script type="module" src="https://<cdn-url>/<bundle-version>/game-replay.js" defer></script>
  </head>
  <body>
    <gt-game-replay roundId="0199f3c2-7a41-7c5e-9b2d-3e8f1a6c4d20"></gt-game-replay>
  </body>
</html>

Messaging and social apps build a link's preview from the page's Open Graph tags. They read the page with a crawler that runs no scripts. For the preview to show the round, your share page must meet these requirements:

  • Server-side rendering. The tags must be in the <head> of the HTML your server sends. Crawlers never see tags added by a script, as in a single-page app. Put them early in the <head>: some apps read only the start of a page.
  • Open to crawlers. The page must load without a login, a bot challenge or a country block. robots.txt must allow it, because X and LinkedIn honour it.
  • The roundId kept. Any redirect must keep the roundId query parameter. So must og:url and <link rel="canonical">, if the page sets them, because some apps preview the canonical URL instead of the shared one.
  • The roundId unchanged. Copy it from the link as it is (it is case-sensitive), and escape it like any value from a URL.
  • A title. og:title is your own text. X shows the card only with a title.

About the image:

  • It is 1200 × 630 and shows the round at its winning moment.
  • The game prepares it once the player's share sheet has loaded the round's replay, so it is usually ready by the time the link is shared. Only rounds shared from the game get an image.
  • Until it is ready, and for a round it can't show, the URL answers 404 and apps show the preview without an image. You can always set the tags.
  • It is kept for 90 days. After that, its URL answers 404.

Events

The following is a list of all available events supported by this component.

Details on how to listen for and dispatch events can be found here.

Outgoing Events

gtGameReplay.out.error

Replay error occurred. Not sent when a round simply has no replay (for example, a round that was not won); the component shows a message instead.

{
  code: string;
  message: string;
}

gtGameReplay.out.init

Replay loaded and ready to play.

{
  roundId: string;
}