MiteSDK

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:

  1. The currentVersion prop, if you pass one.
  2. expo-applicationnativeApplicationVersion.
  3. expo-constantsexpoConfig.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:

PropTypeDefaultDescription
titlestring"What's New"Heading at the top of the sheet
dismissLabelstring'Got it'Dismiss button label
onDismiss() => voidCalled 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

OptionTypeDefaultDescription
currentVersionstringauto-detectedOverride the installed app version
platform'ios' | 'android' | 'all'current Platform.OSRelease platform to fetch notes for
showOnFirstLaunchbooleanfalseShow on a fresh install
limitnumber20Max releases fetched while looking for a match
enabledbooleantrueEnable 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

FieldTypeDescription
visiblebooleanWhether notes should be displayed right now
releasesRelease[]Releases to display
currentVersionstring | nullDetected or provided version, null when undetectable
loadingbooleanWhether releases are being fetched
errorError | nullFetch error, if any
show() => voidShow 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:

SyntaxResult
# H1, ## H2, ### H3Headings
- item or * itemBullet 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.

On this page