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

# Keypoints & events

> Listen to typed keypoints and other pose events with usePoseTracker.

Use `usePoseTracker` inside `PoseTrackerProvider` to subscribe to typed events. Without an API key you get **keypoints-only** mode.

## Keypoints (free)

```tsx theme={null}
import {
  PoseTrackerProvider,
  WebViewPoseView,
  usePoseTracker,
} from '@pose-tracker/react-native-pose-estimation';

function CameraScreen() {
  usePoseTracker({
    onKeypoints: (e) => {
      // e.keypoints: 17 COCO joints · e.score · e.timestampMs
      console.log(e.keypoints.length, e.score);
    },
  });

  return <WebViewPoseView style={{ flex: 1 }} drawSkeleton />;
}

export function App() {
  return (
    <PoseTrackerProvider>
      <CameraScreen />
    </PoseTrackerProvider>
  );
}
```

`KeypointsEvent` shape:

| Field         | Type          | Meaning                          |
| ------------- | ------------- | -------------------------------- |
| `type`        | `'keypoints'` | Event kind                       |
| `keypoints`   | `Keypoint[]`  | 17 joints (name, x, y, score, …) |
| `score`       | `number`      | Mean pose confidence             |
| `timestampMs` | `number`      | Frame time                       |

## Useful `WebViewPoseView` props

| Prop            | Default        | Notes                                     |
| --------------- | -------------- | ----------------------------------------- |
| `drawSkeleton`  | `true`         | Overlay inside the WebView                |
| `coldStart`     | `'full'`       | `'basic'` = model only (no camera)        |
| `loadingText`   | `"AI Loading"` | Boot overlay label                        |
| `position`      | `'front'`      | `'front'` \| `'back'`                     |
| `showWatermark` | plan-derived   | Shown for keyless / free; hidden for paid |

Full table: [WebViewPoseView](/reference/webview-pose-view).

## More typed callbacks

Available on `usePoseTracker({ ... })` when the paid engine is active (API key):

* `onCounter` — `count`, optional `formScore` (`score`, `average`, `grade`)
* `onAngles`, `onPosture`, `onProgression`, `onRecommendations`
* `onFormScore`, `onExerciseSummary`
* Jump events (`onJumpResult`, …)

Without a key, business events are not emitted — only keypoints (and init / error / quality signals).

Full catalog (shapes + error codes): [Events](/reference/events).

## Classic `onMessage` (optional)

For WebView parity with snake\_case payloads (`current_count`, `form_score`):

```tsx theme={null}
usePoseTracker({
  onMessage: (msg) => {
    if (msg.type === 'counter') {
      // msg.current_count · msg.form_score?.grade
    }
  },
});
```

Prefer typed callbacks for new apps.

## Next

[Optional API key + exercise](/api-key) · [Events catalog](/reference/events) · [Quickstart](/quickstart)
