How-to
Mount the native shared-device player
Keep independent instances and expose only redacted handles/callbacks.
Keep the mount handle
import { createHasamiMatch } from "@johnmorrisdotca/gunjin/hasami";
import { mountGunjin } from "@johnmorrisdotca/gunjin/play";
const host=document.createElement("div");
document.body.append(host);
const board=mountGunjin(host,createHasamiMatch({width:7,height:7}),{language:"ja",onChange:position=>console.log(position.phase)});
board.set({material:"wood",pieceStyle:"tiles"});
console.log(board.view().phase,board.replay().length);
board.destroy();The handle exposes redacted views/replay, presentation updates and cleanup. Change/finish callbacks receive public data rather than a full authoritative match. The local hotseat player internally owns both sides and uses the handoff screen to manage shared-device privacy. A competitive remote host needs its own authenticated state boundary.