Hooks Reference
Complete reference for all React hooks provided by the Mite SDK.
Every hook must be called inside a MiteProvider.
| Hook | Purpose |
|---|---|
useMite | Access the Mite instance |
useBugReport | Submit bug reports |
useReleases | Fetch published releases |
useWhatsNew | Once-per-version release notes |
useAnnouncements | Fetch active announcements |
useAnnouncementPopup | Show-once announcement popup |
useFeatureRequests | Board, voting, and submissions |
useMiteNavigationTracking | Record screens for bug reports |
enabled is not consistent across hooks. It defaults to false on
useReleases, useAnnouncements, and useFeatureRequests (opt in to
fetching) but true on useWhatsNew and useAnnouncementPopup (opt out of
the automatic behavior).
useMite
Access the Mite instance from any component within MiteProvider.
import { useMite } from '@usemite/sdk'
const mite = useMite()Throws useMite must be used within a MiteProvider when called outside the
provider.
useBugReport
Submit bug reports with submission state. See Bug Reports.
const { submitBug, submitting, error, lastResponse, refusal, reset } = useBugReport()Return value
| Field | Type | Description |
|---|---|---|
submitBug | (payload: BugReportPayload) => Promise<SubmitBugResult> | Submit a report. Rejects on failure, but not on a quota refusal |
submitting | boolean | Whether a submission is in flight |
error | Error | null | Last submission error |
lastResponse | SubmitBugReportResponse | null | Last successful response |
refusal | MiteQuotaRefusal | null | Set when the account is over a plan limit |
reset | () => void | Clear error, lastResponse, and refusal |
useReleases
Fetch published releases. See Releases.
const { releases, loading, error, refetch } = useReleases({ enabled: true })Options
| Option | Type | Default | Description |
|---|---|---|---|
platform | 'ios' | 'android' | 'all' | unset | Filter by platform |
limit | number | unset | Max number of releases |
enabled | boolean | false | Fetch on mount and when options change |
Return value
| Field | Type | Description |
|---|---|---|
releases | Release[] | Fetched releases |
loading | boolean | Whether a fetch is in flight |
error | Error | null | Fetch error |
refetch | () => Promise<void> | Fetch again. Never rejects |
useWhatsNew
Drive a custom "What's New" UI. See What's New.
const { visible, releases, currentVersion, loading, error, show, dismiss } =
useWhatsNew({ platform: 'ios' })Options
| Option | Type | Default | Description |
|---|---|---|---|
currentVersion | string | auto-detected | Override the installed app version |
platform | 'ios' | 'android' | 'all' | current Platform.OS | Release platform |
showOnFirstLaunch | boolean | false | Show on a fresh install |
limit | number | 20 | Max releases fetched while matching |
enabled | boolean | true | Enable automatic once-per-version behavior |
Return value
| Field | Type | Description |
|---|---|---|
visible | boolean | Whether notes should show now |
releases | Release[] | Releases to display |
currentVersion | string | null | Detected version |
loading | boolean | Whether releases are being fetched |
error | Error | null | Fetch error |
show | () => void | Show regardless of last-seen version |
dismiss | () => Promise<void> | Hide and mark the version seen |
useAnnouncements
Fetch the currently active announcements, newest first. See Announcements.
const { announcements, loading, error, refetch } = useAnnouncements({
enabled: true,
})Options
| Option | Type | Default | Description |
|---|---|---|---|
platform | 'ios' | 'android' | 'all' | unset | Filter by platform |
limit | number | unset | Max number of announcements |
enabled | boolean | false | Fetch on mount and when options change |
Return value
| Field | Type | Description |
|---|---|---|
announcements | Announcement[] | Fetched announcements |
loading | boolean | Whether a fetch is in flight |
error | Error | null | Fetch error |
refetch | () => Promise<void> | Fetch again. Never rejects |
useAnnouncementPopup
Drive a custom announcement UI. See Announcements.
const { visible, announcement, loading, error, show, dismiss } =
useAnnouncementPopup()Options
| Option | Type | Default | Description |
|---|---|---|---|
platform | 'ios' | 'android' | 'all' | current Platform.OS | Announcement platform |
limit | number | 10 | Max announcements fetched |
enabled | boolean | true | Enable automatic show-once behavior |
Return value
| Field | Type | Description |
|---|---|---|
visible | boolean | Whether the announcement should show now |
announcement | Announcement | null | The latest active announcement |
loading | boolean | Whether announcements are being fetched |
error | Error | null | Fetch error |
show | () => void | Show the latest announcement even when seen |
dismiss | () => Promise<void> | Hide and mark the announcement seen |
useFeatureRequests
Board, voting, and submissions. See Feature Requests.
const {
featureRequests,
votedFeatureRequestIds,
loading,
error,
refetch,
submitFeatureRequest,
submitting,
submitError,
toggleVote,
votingFeatureRequestIds,
} = useFeatureRequests({ enabled: true })Options
| Option | Type | Default | Description |
|---|---|---|---|
enabled | boolean | false | Fetch board and vote state on mount |
voterEmail | string | — | Deprecated. Look up votes by email |
Return value
| Field | Type | Description |
|---|---|---|
featureRequests | FeatureRequest[] | The board |
votedFeatureRequestIds | string[] | IDs the user voted for |
loading | boolean | Whether the board is loading |
error | Error | null | Fetch error |
refetch | () => Promise<void> | Refetch. Never rejects |
submitFeatureRequest | (input: SubmitFeatureRequestInput) => Promise<CreateFeatureRequestResponse> | Create, then refetch |
submitting | boolean | Submission in flight |
submitError | Error | null | Submission error |
toggleVote | (id: string) => Promise<VoteFeatureRequestResponse> | Toggle a vote, optimistically |
votingFeatureRequestIds | string[] | IDs with a vote in flight |
useMiteNavigationTracking
Record screen changes for the navigation trail.
useMiteNavigationTracking(navigationRef)Accepts a navigation container ref from Expo Router or React Navigation, or
null/undefined. Returns nothing. Logs a [Mite] warning and disables
breadcrumbs when the ref does not expose getCurrentRoute and addListener.
Non-hook helpers
These are plain functions, usable outside React:
| Function | Description |
|---|---|
recordNavigationBreadcrumb(screen) | Record a screen manually |
getNavigationTrail() | Get a copy of the trail, oldest first |
clearNavigationTrail() | Clear all breadcrumbs |
showWhatsNew() | Open a mounted WhatsNew sheet |
showAnnouncement() | Open a mounted AnnouncementPopup |