What's New
Show published release notes in-app after an update, once per version.
WhatsNew shows the release notes for the version the user just updated to. It
tracks the last acknowledged version locally and shows once per new app version,
so a user who has already seen 1.4.0 will not see it again.
import { MiteProvider, WhatsNew } from '@usemite/sdk'
export default function RootLayout() {
return (
<MiteProvider miteInstance={mite}>
{/* Your app */}
<WhatsNew />
</MiteProvider>
)
}Mount it once inside MiteProvider. It renders a sheet only when there are
notes to show.
How the version is detected
The installed app version is resolved in this order:
- The
currentVersionprop, if you pass one. expo-application→nativeApplicationVersion.expo-constants→expoConfig.version.
Both Expo modules are optional. If neither is installed and you do not pass
currentVersion, the SDK logs a [Mite] warning and the widget stays hidden —
it has no version to compare against.
A release is shown when its version exactly matches the detected app
version. Publish a release in Mite whose version string matches what ships in
your build, or nothing will match.
The acknowledged version is stored under @mite/sdk-last-seen-release, using
the same identityStorage as identity
state. Without persistent storage the "seen" state resets on reload and the
sheet reappears.
First launch
By default nothing is shown on a fresh install — there is no "what's new" for a
user who has never used the app. The current version is silently recorded as
seen instead. Opt in with showOnFirstLaunch:
<WhatsNew showOnFirstLaunch />Opening it on demand
import { showWhatsNew } from '@usemite/sdk'
<Button title="What's new" onPress={showWhatsNew} />This works regardless of the last-seen version, and shows recent releases even
when none match the current version. It requires a mounted <WhatsNew /> — it
logs a [Mite] warning and no-ops otherwise.
Props
WhatsNew accepts every useWhatsNew option plus:
| Prop | Type | Default | Description |
|---|---|---|---|
title | string | "What's New" | Heading at the top of the sheet |
dismissLabel | string | 'Got it' | Dismiss button label |
onDismiss | () => void | — | Called after dismissal and after the version is marked seen |
The sheet follows the system color scheme automatically.
Custom UI
Use useWhatsNew to render your own:
import { useWhatsNew } from '@usemite/sdk'
function ReleaseNotesBanner() {
const { visible, releases, currentVersion, loading, error, show, dismiss } =
useWhatsNew({ platform: 'ios' })
if (!visible) return null
return (
<Banner onClose={dismiss}>
{releases.map(release => (
<Text key={release.id}>{release.notes}</Text>
))}
</Banner>
)
}Hook options
| Option | Type | Default | Description |
|---|---|---|---|
currentVersion | string | auto-detected | Override the installed app version |
platform | 'ios' | 'android' | 'all' | current Platform.OS | Release platform to fetch notes for |
showOnFirstLaunch | boolean | false | Show on a fresh install |
limit | number | 20 | Max releases fetched while looking for a match |
enabled | boolean | true | Enable the automatic once-per-version behavior |
Unlike useReleases, enabled here defaults to true — the
whole point of the hook is the automatic behavior. Setting it to false
leaves only the imperative show() path active.
Hook return value
| Field | Type | Description |
|---|---|---|
visible | boolean | Whether notes should be displayed right now |
releases | Release[] | Releases to display |
currentVersion | string | null | Detected or provided version, null when undetectable |
loading | boolean | Whether releases are being fetched |
error | Error | null | Fetch error, if any |
show | () => void | Show notes regardless of last-seen version |
dismiss | () => Promise<void> | Hide and mark the current version as seen |
Supported markdown
Release notes render through a deliberately small markdown subset — enough to structure notes, without pulling in a full markdown engine:
| Syntax | Result |
|---|---|
# H1, ## H2, ### H3 | Headings |
- item or * item | Bullet list item |
**text** | Bold |
*text* or _text_ | Italic |
`code` | Inline code |
Anything else renders as plain paragraph text. Links, images, tables, and fenced code blocks are not supported.
Reading the seen version directly
const lastSeen = await mite.getLastSeenReleaseVersion() // string | null
await mite.setLastSeenReleaseVersion('1.4.0')Useful for resetting the widget in a debug menu, or for marking a version seen from your own UI.