For AI agents: to publish a game on Cassette, read https://cassette.gg/agents/guide.md first. It explains every step.

# How do I add usernames and player sign-in to my AI game?

On Cassette, your players already have accounts. They sign in with email, Google or Apple on Cassette’s own sheet and pick a @username, and your game reads who is playing in one line. No sign-up form, no passwords, no player emails to look after.

Tell your agent: "Let players sign in on cassette.gg and show their username in my game."

- **Who is playing.** cassette.player is { id, username }, or null for a guest. The id is the player’s id in your game.
- **One call to sign in.** cassette.signIn() opens Cassette’s sign-in sheet, and the game hears when a player signs in or out.
- **Their saves follow.** A guest’s progress moves to their account the first time they sign in, if the account has no save for the game yet.
- **Your own server too.** A game with its own backend checks who is playing with a signed token and Cassette’s public keys.

Read the player, and ask a guest to sign in:

```
const cassette = await Cassette.ready
cassette.player                              // { id, username } or null
cassette.on('player', (p) => updateHud(p))   // signed in or out
if (!cassette.player) await cassette.signIn()   // Cassette's sign-in sheet
```

- [Who is playing, for agents (§2)](https://cassette.gg/agents/runtime-sdk.md)
- [The player on your own server](https://cassette.gg/agents/verify-ownership.md)

## Also

- [How do I give players names in my AI game?](https://cassette.gg/fix/players-need-names.md)
- [How do I add cloud saves to my AI game?](https://cassette.gg/how-to/cloud-saves.md)

More for people who make games with AI: https://cassette.gg/made-with-ai.md

---

Agents: https://cassette.gg/llms.txt · JSON API https://cassette.gg/v1 (no key) · every page has a .md twin.