MiteSDK

Hooks Reference

Complete reference for all React hooks provided by the Mite SDK.

Every hook must be called inside a MiteProvider.

HookPurpose
useMiteAccess the Mite instance
useBugReportSubmit bug reports
useReleasesFetch published releases
useWhatsNewOnce-per-version release notes
useAnnouncementsFetch active announcements
useAnnouncementPopupShow-once announcement popup
useFeatureRequestsBoard, voting, and submissions
useMiteNavigationTrackingRecord 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

FieldTypeDescription
submitBug(payload: BugReportPayload) => Promise<SubmitBugResult>Submit a report. Rejects on failure, but not on a quota refusal
submittingbooleanWhether a submission is in flight
errorError | nullLast submission error
lastResponseSubmitBugReportResponse | nullLast successful response
refusalMiteQuotaRefusal | nullSet when the account is over a plan limit
reset() => voidClear error, lastResponse, and refusal

useReleases

Fetch published releases. See Releases.

const { releases, loading, error, refetch } = useReleases({ enabled: true })

Options

OptionTypeDefaultDescription
platform'ios' | 'android' | 'all'unsetFilter by platform
limitnumberunsetMax number of releases
enabledbooleanfalseFetch on mount and when options change

Return value

FieldTypeDescription
releasesRelease[]Fetched releases
loadingbooleanWhether a fetch is in flight
errorError | nullFetch 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

OptionTypeDefaultDescription
currentVersionstringauto-detectedOverride the installed app version
platform'ios' | 'android' | 'all'current Platform.OSRelease platform
showOnFirstLaunchbooleanfalseShow on a fresh install
limitnumber20Max releases fetched while matching
enabledbooleantrueEnable automatic once-per-version behavior

Return value

FieldTypeDescription
visiblebooleanWhether notes should show now
releasesRelease[]Releases to display
currentVersionstring | nullDetected version
loadingbooleanWhether releases are being fetched
errorError | nullFetch error
show() => voidShow 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

OptionTypeDefaultDescription
platform'ios' | 'android' | 'all'unsetFilter by platform
limitnumberunsetMax number of announcements
enabledbooleanfalseFetch on mount and when options change

Return value

FieldTypeDescription
announcementsAnnouncement[]Fetched announcements
loadingbooleanWhether a fetch is in flight
errorError | nullFetch 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

OptionTypeDefaultDescription
platform'ios' | 'android' | 'all'current Platform.OSAnnouncement platform
limitnumber10Max announcements fetched
enabledbooleantrueEnable automatic show-once behavior

Return value

FieldTypeDescription
visiblebooleanWhether the announcement should show now
announcementAnnouncement | nullThe latest active announcement
loadingbooleanWhether announcements are being fetched
errorError | nullFetch error
show() => voidShow 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

OptionTypeDefaultDescription
enabledbooleanfalseFetch board and vote state on mount
voterEmailstringDeprecated. Look up votes by email

Return value

FieldTypeDescription
featureRequestsFeatureRequest[]The board
votedFeatureRequestIdsstring[]IDs the user voted for
loadingbooleanWhether the board is loading
errorError | nullFetch error
refetch() => Promise<void>Refetch. Never rejects
submitFeatureRequest(input: SubmitFeatureRequestInput) => Promise<CreateFeatureRequestResponse>Create, then refetch
submittingbooleanSubmission in flight
submitErrorError | nullSubmission error
toggleVote(id: string) => Promise<VoteFeatureRequestResponse>Toggle a vote, optimistically
votingFeatureRequestIdsstring[]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:

FunctionDescription
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

On this page