MiteSDK

Releases

Fetch and display published app releases with the Mite SDK.

Fetch the releases you have published in Mite, optionally filtered by platform. To show release notes to users automatically after an update, see What's New — it is built on top of this.

Using the hook

import { useReleases } from '@usemite/sdk'

export default function ReleasesScreen() {
  const { releases, loading, error, refetch } = useReleases({
    platform: 'ios',
    limit: 10,
    enabled: true,
  })

  if (loading) return <Text>Loading...</Text>
  if (error) return <Text>Error: {error.message}</Text>

  return (
    <FlatList
      data={releases}
      keyExtractor={item => item.id}
      renderItem={({ item }) => (
        <View>
          <Text>{item.version} (Build {item.versionCode})</Text>
          <Text>{item.notes}</Text>
        </View>
      )}
      onRefresh={refetch}
      refreshing={loading}
    />
  )
}

enabled defaults to false. The hook fetches nothing until you pass enabled: true. This makes it easy to defer the request until a screen is actually visible — but it also means omitting the option gives you an empty list, not a loading state.

Options

OptionTypeDefaultDescription
platform'ios' | 'android' | 'all'unsetFilter by platform. When omitted, no filter is sent and the server decides
limitnumberunsetMax number of releases to return
enabledbooleanfalseFetch on mount, and refetch when the options change

Return value

FieldTypeDescription
releasesRelease[]Fetched releases, [] until loaded
loadingbooleanWhether a fetch is in flight. Starts as the value of enabled
errorError | nullError from the last fetch
refetch() => Promise<void>Fetch again, regardless of enabled

refetch never rejects — failures land on error and are logged as [Mite] useReleases error:. That makes it safe to pass straight to onRefresh.

Direct API access

import { useMite } from '@usemite/sdk'

const mite = useMite()

const releases = await mite.getReleases({
  platform: 'android',
  limit: 5,
})

Unlike the hook, getReleases throws on failure. Both platform and limit are optional; omitted options are left off the query string entirely.

The Release object

interface Release {
  id: string
  version: string
  versionCode: number
  platform: 'ios' | 'android' | 'all'
  notes?: string
  releasedAt?: number
  createdAt: number
}
FieldDescription
idUnique release identifier
versionHuman-readable version, e.g. 1.4.0. Matched against the installed app version by What's New
versionCodeNumeric build number
platformTarget platform, or all
notesRelease notes. Supports a markdown subset
releasedAtPublish timestamp in ms, when set
createdAtCreation timestamp in ms

On this page