Repo of the Day
realm/realm-js
Published: Feb 12, 2023
Open repository ↗Realm is a mobile database: an alternative to SQLite & key-value stores
Summary
realm-js is the JavaScript and TypeScript implementation of the Realm mobile database, an embedded NoSQL store that runs directly inside phones, tablets, wearables, and Node.js or Electron hosts. The repository carries a deprecation notice from September 2024 announcing the end of Atlas Device Sync and the Realm SDKs, with a sync-free continuation published under the community npm tag and a community git branch. The project is published under Apache License 2.0.
What it is useful for
The library targets clients that need a local object database without an ORM, since data is exposed directly as objects and queried in code. Documented features include support for relationships, generics, and vector queries, plus a reactive model that fits offline-first mobile or desktop apps. The package supports React Native on iOS and Android with both JSC and Hermes engines, plus Node.js and Electron on Windows, macOS, and Linux. For React Native, the related @realm/react package provides hooks, and @realm/babel-plugin generates Realm schemas from TypeScript classes decorated like the Task model in the README, which uses @index and a static primaryKey.
How engineers can use it
Detailed installation lives in the linked Atlas Device SDK docs rather than this README, so engineers should start there. The README documents a few prerequisites directly: Node.js version 18 or later is required, and a compatibility matrix lists supported React Native versions. Template projects are linked for both Expo and React Native to bootstrap a new app. A TypeScript model is defined by extending Realm.Object, with the babel plugin producing the underlying schema. When installation produces a "Could not find the Realm binary" error, the README lists recovery commands by platform: npx pod-install plus clearing Pods, Podfile.lock, and ~/Library/Developer/Xcode/DerivedData on iOS; ./gradlew clean and rebuilding on Android; and for Expo, installing expo-dev-client then running npx expo run:ios or npx expo run:android, or npx expo start --dev-client to start the bundler without rebuilding. A documented limitation is incompatibility with the legacy Chrome Debugger, with the Hermes Debugger and Safari listed as the supported alternatives. Engineers planning new work should account for the deprecation notice and prefer the community branch if they do not need sync.