NitroSQLite
React Native

Install on React Native

Install Nitro SQLite in a React Native or Expo native app on iOS and Android.

This guide adds react-native-nitro-sqlite to a React Native app. The native module opens SQLite files inside the app's storage directory. After installation, run your first query.

These instructions install the 11.0.0 alpha from the alpha npm tag. Stable 10.x stays on the latest tag. If you stay on 10.x, use the documentation for that release.

Requirements

Use React Native 0.88 or newer with the New Architecture. Nitro V1 iOS builds require Xcode with Swift 6.4 or newer. Your app's platform requirements can exceed Nitro SQLite's iOS 16 minimum.

The instructions below cover iOS and Android. For the legacy macOS example and the visionOS declaration, see supported platforms.

1. Install the packages

Install the package from the alpha tag with the Nitro Modules version used by its generated bindings:

npm install --save-exact react-native-nitro-sqlite@alpha react-native-nitro-modules@1.0.0-alpha.nightly.138.g43e09c161101

Save exact versions for every 11.0.0 alpha package, including companions. Without --save-exact, npm saves ^11.0.0-alpha.0. That range also matches the older 11.0.0-nitro-v1.x builds, because npm sorts prerelease names alphabetically. With Yarn or Bun, pass --exact; with pnpm, pass --save-exact.

Existing apps that use an earlier Nitro SQLite release can follow the Nitro V1 migration guide.

2. Set up the native project

On iOS, set an explicit deployment target for each app build configuration. Follow the Swift Package Manager setup, including the steps for apps that also use CocoaPods.

Android needs no additional Nitro SQLite configuration for the default setup. The configuration pages cover build options and platform storage settings.

3. Build the native app

An existing binary cannot load a native module added only to JavaScript. In a standard React Native CLI project, build the app for your platform:

npm run ios
# or
npm run android

If the app uses different scripts, run its equivalent native build.

Expo native builds

Use an Expo SDK whose native app meets the React Native and Nitro requirements above. Expo Go cannot load this native module. Follow the Expo configuration guide to generate the native project and configure Swift Package Manager on iOS. Build the development app for your platform:

npx expo run:ios
# or
npx expo run:android

4. Run a query

Continue with your first React Native query. It creates a table, saves a note, and reads the note back.

On this page