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.
The source is at github.com/usemite/mite-sdk.
Installation
npm install @usemite/sdkThe 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.
| Package | Required | Needed for |
|---|---|---|
react ^19.1.0 | Yes | — |
react-native ^0.81.5 | Yes | — |
expo-device >=57.0.0 | Yes | Device info on bug reports |
expo-sensors >=57.0.0 | No | Shake detection (ShakeToReport) |
react-native-view-shot | No | Screenshot capture (ShakeToReport) |
expo-store-review >=57.0.0 | No | Native review dialog (StoreReviewPrompt) |
expo-application >=57.0.0 | No | App version detection (What's New) |
expo-constants >=57.0.0 | No | App version fallback (What's New) |
expo-router >=57.0.0 | No | Navigation breadcrumbs |
@react-navigation/native >=6.0.0 | No | Navigation 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
}| Option | Type | Default | Description |
|---|---|---|---|
apiKey | string | — | Your project API key. Required for every network call; methods throw without it |
endpoint | string | Mite's hosted API | Override the backend base URL |
timeout | number | 5000 | Request timeout in ms |
retries | number | 0 | Automatic retry attempts, with exponential backoff capped at 10s |
anonymousId | string | generated | Override the generated anonymous identifier |
identityStorage | MiteIdentityStorage | MiteMMKVLikeStorage | in-memory | AsyncStorage-compatible adapter or an MMKV instance |
identificationOptOut | boolean | false | Start in anonymous-only mode |
enableOfflineQueue | boolean | true | Retry bug reports that fail on a network error |
enableNavigationBreadcrumbs | boolean | true | Attach the navigation trail to bug reports |
maxNavigationBreadcrumbs | number | 20 | Screens kept in the navigation trail |
onQuotaExceeded | (refusal) => void | — | Called 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?
- Identity Management — how anonymous and identified users work
- Bug Reports — submit reports with attachments
- In-App Bug Reporting — shake gesture, screenshot, annotation
- Releases — fetch published releases
- What's New — show release notes after an update
- Feature Requests — board, voting, and submissions
- Store Review Prompt — route happy users to the app store
- Navigation Breadcrumbs — screen trail on bug reports
- Offline Queue — retry behavior for failed reports