---
title: Hook Guide
description: Every hook the SDK gives you, what it's for, and when to reach for it. Exact signatures live in the package README.
---

Each hook is one job. Pick the one that matches what you're building; the SDK hides the plumbing.

For the full signatures, return shapes, and cache semantics, see the [package README](https://github.com/thinkwork-ai/thinkwork/blob/main/packages/react-native-sdk/README.md).

## Who's signed in

### `useThinkworkAuth`

Tells you whether someone's signed in and gives you a way to sign them in or out. You'll use this early — probably at your app root, to gate screens behind authentication.

## Agents

### `useAgents`

Gives you the list of agents a tenant has. Use this to build an agent picker. The SDK intentionally stays out of selection state — you decide how the user chooses one, and where you store their choice.

## Threads

### `useThreads`

The thread list for a tenant, optionally filtered by agent, status, priority, type, and a few others. Most list screens call this one.

### `useThread`

A single thread by ID. Use it when you're rendering a thread detail view and need the title, status, or other metadata.

### `useUnreadThreadCount`

A number: how many threads have new activity the user hasn't seen. Use this to drive tab‑bar badges or notification dots without scanning threads yourself.

### `useCreateThread`

Make a new thread. Pass a `firstMessage` and the thread + opening user message get created in one round trip — no need to create then send.

### `useUpdateThread`

Change something on a thread: mark it read, archive it, change its status. Works for any thread ID — you pass it when you call the function, not when the hook mounts.

## Messages

### `useMessages`

All the messages in a thread. Auto‑updates when new ones arrive; you don't wire subscriptions yourself.

### `useSendMessage`

Send a message to a thread. You pass the thread ID at send time, so the same hook works for brand‑new threads and ones that have been mounted forever.

## Real‑time

The SDK subscribes for you automatically inside `useMessages`, but sometimes you want to listen outside a messages list.

### `useNewMessageSubscription`

Fires when a new message lands on a specific thread. Handy for notifications or typing indicators.

### `useThreadUpdatedSubscription`

Tenant‑wide stream — fires whenever any thread's status or title changes. Useful for dashboards.

### `useThreadTurnSubscription` / `useThreadTurnUpdatedSubscription`

Agent turn progress — "is the agent still thinking?". The first is scoped to one thread; the second is tenant‑wide.

---

## Types to import

All the data shapes (`Thread`, `Agent`, `Message`, `CreateThreadInput`, etc.) re‑export from the package root, so you can type your own components against them without digging.

```tsx
import type { Thread, Agent, Message } from "@thinkwork/react-native-sdk";
```
