# HEARTBEAT_PING_FRAME
Source: https://docs.maelstrom-ai.co/0.2/reference/connectors/variables/heartbeat_ping_frame/
Documentation revision: 89a8f5e9d10cedcf0b30376d7846113f06f26120
SDK manifests in this build: @maelstrom-co/react@0.2.1, @maelstrom-co/client@0.2.1, @maelstrom-co/connectors@0.2.1, @maelstrom-co/protocol@0.2.1, @maelstrom-co/engine@0.2.1
These docs follow this source revision. Manifest versions do not prove release compatibility; verify the installed package exports before using an API.

> `const` **HEARTBEAT\_PING\_FRAME**: “{"type":"heartbeat.ping"}” = `'{"type":"heartbeat.ping"}'`

Defined in: packages/connectors/src/heartbeat-frame.ts:20

Wire shape of the WebSocket heartbeat mechanism configured by `@maelstrom-co/client`’s `WebSocketConnectorOptions.heartbeatIntervalMs` option. These frames are transport-level only: they are deliberately **not** part of the `@maelstrom-co/protocol` envelope union, so a host answering the heartbeat (e.g. a hosted deployment’s server) must match this shape exactly rather than reimplementing it from memory or trying to route it through the protocol codec.

## Example

```ts
// Server-side: reply to every ping with a pong, verbatim.
ws.addEventListener('message', (event) => {
  if (event.data === HEARTBEAT_PING_FRAME) {
    ws.send(HEARTBEAT_PONG_FRAME);
  }
});
```
