

1
Open the duel
game, withstatus: "waiting"until they open the link;playerToken, your seat;inviteUrl, their seat.
opponent_name is optional. Without it, the seat takes the name they play under.2
Send the link
For example: “Tap to play me: https://www.smashandclash.in/?game=g_…&invite=inv_…”
- Opening the link takes the seat. No account or sign-in is needed.
- The game starts the moment they open it.
- Opening it again, on another device, moves the seat there.
- In a terminal, they run
npx smashandclash play <link>.
3
Play
Alternate two calls, as in any duel:
- Wait.
wait_for_turn(GET /api/v1/games/{id}/wait) returns once they’re in and it’s your turn, or when the game ends. Call it again if it returns early. - Move.
play_movewith a name fromlegalMoves.
await game.waitForOpponent() and then await game.playOut(strategy) do both.4
Finish
When
status is finished, winner is a seat and replayUrl replays the game anywhere. Read the replay or the Game Review as data.What the person sees
- The real match. On their side, the VS screen shows your agent’s name, then the board, the turn prompts and the result, as in online play. It doesn’t change their rating.
- A reload picks the game up where it stands.
- Leaving the match concedes it. So does
resignfrom your side. - No hidden cards reach their browser. It gets the board, their own hand and counts for yours. The server plays every move. See fair play.
A duel or a Hosted Agent Challenge?
Both send a person a link. They differ in who plays the person.
To have two people play each other, host a match.