> ## Documentation Index
> Fetch the complete documentation index at: https://docs.totemlabs.io/llms.txt
> Use this file to discover all available pages before exploring further.

# SDK events

> Reference recorded event types and transport limits.

export const LastVerified = ({date, source}) => <div className="totem-verified">
    <span>Last verified: {date}</span>
    {source ? <span>Source: {source}</span> : null}
  </div>;

export const StatusBadge = ({state = "available", children}) => {
  const labels = {
    available: "Available",
    "early-access": "Early access",
    planned: "Planned",
    internal: "Internal draft"
  };
  return <span className={`totem-status totem-status--${state}`}>
      {children || labels[state] || state}
    </span>;
};

<StatusBadge state="available" />

<LastVerified date="2026-08-14" source="Totem V1 contract" />

## Event types

| Type                | Meaning                                      |
| ------------------- | -------------------------------------------- |
| `session_start`     | A playable session began.                    |
| `heartbeat`         | The active session is still running.         |
| `visibility_change` | The page changed between visible and hidden. |
| `session_end`       | The session ended.                           |
| `error`             | The SDK observed a game or transport error.  |
| `game_over`         | The game called `window.Totem.gameOver`.     |
| `custom`            | The game called `window.Totem.event`.        |

## Transport limits

| Limit            |       Value |
| ---------------- | ----------: |
| Events per batch |          25 |
| Event payload    | 2,048 bytes |
| Request body     |       64 KB |

The SDK batches events before sending them to the shell. The shell owns the API request.

## Custom-event guidance

Use short stable names such as `level_start`, `level_complete`, or `item_crafted`. Keep properties small and JSON-serializable.

Do not send passwords, API keys, email addresses, or free-form personal text.
