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.

Published React Native releases remain available, including 10.x and the nitro-v1 prereleases. The instructions below install this source checkout from local archives. Its React Native package versions remain provisional. Use the documentation for your installed release when staying on an existing version.

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

To try the Nitro V1 source in this checkout, first build the SQLite archive from a source checkout with workspace dependencies installed:

cd packages/react-native-nitro-sqlite
bun run pack

The packing step prints the archive filename with its recorded package version. Replace VERSION below with that version. Install it in your app with the Nitro Modules version used by its generated bindings:

npm install /path/to/react-native-nitro-sqlite-VERSION.tgz react-native-nitro-modules@1.0.0-alpha.nightly.138.g43e09c161101

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