MiteSDK

Getting Started

Get up and running with the Mite SDK for React Native.

Mite is a React Native SDK for bug reporting, release management, and feature requests. It ships ready-made UI (shake-to-report, a "What's New" widget, a feature request board) alongside hooks and a plain imperative API if you would rather build your own.

Installation

npm install @usemite/sdk

The package is @usemite/sdk. The older @usemite/mite-sdk name is no longer published to and is frozen at 0.1.2 — if you installed it, switch to @usemite/sdk.

Peer dependencies

react, react-native, and expo-device are required. Everything else is optional and only needed for the feature that uses it — when a module is missing the SDK logs a [Mite] warning and degrades gracefully instead of crashing.

PackageRequiredNeeded for
react ^19.1.0Yes
react-native ^0.81.5Yes
expo-device >=57.0.0YesDevice info on bug reports
expo-sensors >=57.0.0NoShake detection (ShakeToReport)
react-native-view-shotNoScreenshot capture (ShakeToReport)
expo-store-review >=57.0.0NoNative review dialog (StoreReviewPrompt)
expo-application >=57.0.0NoApp version detection (What's New)
expo-constants >=57.0.0NoApp version fallback (What's New)
expo-router >=57.0.0NoNavigation breadcrumbs
@react-navigation/native >=6.0.0NoNavigation breadcrumbs

Setup

1. Initialize Mite

Create a Mite instance and initialize it in your app's entry point:

import AsyncStorage from '@react-native-async-storage/async-storage'
// or: import { MMKV } from 'react-native-mmkv'
import { Mite, MiteProvider } from '@usemite/sdk'

const mite = new Mite({
  apiKey: process.env.EXPO_PUBLIC_MITE_API_KEY,
  identityStorage: AsyncStorage, // or: new MMKV()
})

mite.init()

export default function RootLayout() {
  return (
    <MiteProvider miteInstance={mite}>
      {/* Your app */}
    </MiteProvider>
  )
}

mite.init() sets up the offline queue and syncs the anonymous identity in the background. Call it once, after constructing the instance.

Pass identityStorage unless you have a reason not to. Without it the anonymous ID lives in memory only and resets on every full app reload, so the same user looks like a new user each launch. The SDK logs a [Mite] warning at init() when no persistent storage is configured.

2. Configuration options

interface MiteConfig {
  apiKey?: string
  endpoint?: string
  timeout?: number
  retries?: number
  anonymousId?: string
  identityStorage?: MiteIdentityStorage | MiteMMKVLikeStorage
  identificationOptOut?: boolean
  enableOfflineQueue?: boolean
  enableNavigationBreadcrumbs?: boolean
  maxNavigationBreadcrumbs?: number
  onQuotaExceeded?: (refusal: MiteQuotaRefusal) => void
}
OptionTypeDefaultDescription
apiKeystringYour project API key. Required for every network call; methods throw without it
endpointstringMite's hosted APIOverride the backend base URL
timeoutnumber5000Request timeout in ms
retriesnumber0Automatic retry attempts, with exponential backoff capped at 10s
anonymousIdstringgeneratedOverride the generated anonymous identifier
identityStorageMiteIdentityStorage | MiteMMKVLikeStoragein-memoryAsyncStorage-compatible adapter or an MMKV instance
identificationOptOutbooleanfalseStart in anonymous-only mode
enableOfflineQueuebooleantrueRetry bug reports that fail on a network error
enableNavigationBreadcrumbsbooleantrueAttach the navigation trail to bug reports
maxNavigationBreadcrumbsnumber20Screens kept in the navigation trail
onQuotaExceeded(refusal) => voidCalled on a plan quota refusal

apiKey is typed as optional so you can construct an instance without one, but every method that talks to the API (submitBug, identify, getReleases, all feature request methods) throws [Mite] API key is required to … when it is missing.

3. Access the instance

Any component under MiteProvider can reach the instance with useMite():

import { useMite } from '@usemite/sdk'

function ReportButton() {
  const mite = useMite()
  // ...
}

useMite() throws if called outside a MiteProvider.

Drop-in UI

The fastest way to get value out of Mite is to mount the prebuilt components. Each one is self-contained and only needs to sit inside MiteProvider:

import { ShakeToReport, WhatsNew } from '@usemite/sdk'

<MiteProvider miteInstance={mite}>
  {/* Your app */}
  <ShakeToReport />
  <WhatsNew />
</MiteProvider>

What's next?

On this page