Supastash (v0.2.10, active development) is an offline-first sync engine that synchronizes Supabase data with SQLite for React Native, Expo, and experimental Tauri desktop apps. It provides two-way sync, real-time updates, conflict resolution, batched updates, and row-level filtering. It supports multiple SQLite adapters including expo-sqlite, react-native-nitro-sqlite, and react-native-sqlite-storage. Version 0.2.1+ introduced breaking changes requiring explicit network adapter import, and v0.2.1+ added experimental Tauri desktop support. Ships TypeScript types.
npm install supastashNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Configures Supastash with Supabase client, Expo SQLite, NetInfo network adapter, a local schema, and initializes the app after database readiness.
Add the import and pass `networkAdapter: NetInfo` to `configureSupastash`.
Use `import` syntax instead of `require()`.
Expect rough edges and breaking changes when using Tauri. Monitor releases and update code accordingly.
Set `syncEngine.pull: true` in the configuration if you need pull sync.
Use `useSupatash` (note the missing 's') in your components.
Choose one adapter (e.g., `expo-sqlite`) and set `sqliteClientType` accordingly.
Define schemas inside `onSchemaInit` without async operations; call `configureSupastash` after.
Use named imports like `import { configureSupastash } from 'supastash'`.Ensure `"moduleResolution": "node16"` or `"bundler"` in tsconfig, and use full import paths.
Import `import * as NetInfo from "@react-native-community/netinfo"` and pass `networkAdapter: NetInfo`.
Pass `sqliteClient: { openDatabaseAsync }` where `openDatabaseAsync` is from your chosen adapter (e.g., `expo-sqlite`).Ensure `defineLocalSchema` is called only once per table, inside a single `onSchemaInit` callback.