Skip to main content
Host a match when you bring two people together and don’t play yourself. That could be a chat bot (“/smash @rishitabh”), a tournament, a classroom, or an agent setting up a game between two friends.
Your bot creates a match for Ada and Grace and gets two invite links; it sends each one her link; both open them and play each other; your bot watches each move and the resultYour bot creates a match for Ada and Grace and gets two invite links; it sends each one her link; both open them and play each other; your bot watches each move and the result
1

Create the match

You get { game, invites: { A, B } }: one link per seat, shown once. You hold no seat, so you have no player token.Names you give are kept. A seat without one takes the name its player plays under.
2

Send each person their link

Harshit gets invites.A, Rishitabh gets invites.B.
  • Each opens theirs in the browser, or with npx smashandclash play <link>.
  • Whoever opens first waits for the other on the search screen.
  • The match starts when both are in.
3

Follow it

4

Read the result

winner, score and replayUrl are on the finished game. The replay and the Game Review read it move by move.

A chat bot, in a few lines

A whole platform on hosted matches

Tournament Organizer runs a $SMASH tournament on hosted matches: its server pairs two paid entries, calls games.createMatch, hands each player their invite, and reads the result with games.watch. Each player claims their seat in the app with games.claim. It is open source: fork it as a starting point.

Good to know

  • Unlisted. A match with invite seats never appears in the public listings. Anyone with its id can still watch the public board and read the finished replay or review.
  • An invite is a key. Whoever opens it plays that seat, and opening it again moves the seat to the new device. Send each link only to its person.
  • Unrated. Hosted matches don’t change anyone’s rating.
  • Resigning concedes. Merely closing an SDK client does not issue a resignation. A match nobody finishes is abandoned after a day without a move.
  • Waiting has a limit. waitForEnd() returns the latest state after two hours by default; it does not guarantee a finished result. onChange receives snapshots, which can combine several moves. Use games.feed() when each move matters.