Skip to main content
These standalone functions provide the same functionality as the VersionCheck object methods, allowing you to import only what you need.

getCountry()

Returns the device’s current 2-letter ISO country code.
function getCountry(): string
return
string
2-letter ISO country code

Example

import { getCountry } from 'react-native-nitro-version-check';

const country = getCountry(); // "US"
console.log(`User is in: ${country}`);

getStoreUrl()

Returns the store URL for this app. Automatically resolves to the App Store on iOS and Play Store on Android.
function getStoreUrl(): Promise<string>
return
Promise<string>
Store URL for the current app

Example

import { getStoreUrl } from 'react-native-nitro-version-check';
import { Linking } from 'react-native';

const url = await getStoreUrl();
Linking.openURL(url);

getLatestVersion()

Fetches the latest version of this app available in the store.
function getLatestVersion(): Promise<string>
return
Promise<string>
Latest version available in the app store

Example

import { getLatestVersion } from 'react-native-nitro-version-check';

const latest = await getLatestVersion(); // "1.3.0"
console.log(`Latest version: ${latest}`);

needsUpdate()

Checks whether an app update is available. Uses semantic version comparison. By default checks for any version increase, but you can filter by granularity:
  • "major" — only returns true for major bumps (1.x → 2.x)
  • "minor" — returns true for major or minor bumps
  • "patch" — returns true for any version increase (default)
function needsUpdate(options?: { level?: UpdateLevel }): Promise<boolean>

Parameters

options
object
Configuration options for update checking
level
UpdateLevel
default:"patch"
Granularity level for update checks. One of:
  • "major" — only major version bumps (1.x → 2.x)
  • "minor" — major or minor bumps (1.2.x → 1.3.x)
  • "patch" — any version increase (default)

Returns

return
Promise<boolean>
true if an update is available at the specified level, false otherwise

Examples

import { needsUpdate, getStoreUrl } from 'react-native-nitro-version-check';
import { Linking } from 'react-native';

if (await needsUpdate()) {
  const url = await getStoreUrl();
  Linking.openURL(url);
}

Type Definitions

UpdateLevel

type UpdateLevel = "major" | "minor" | "patch"
Defines the granularity of version comparison for update checks.

Build docs developers (and LLMs) love