powersync

Build local-first, offline-capable TypeScript apps with PowerSync. Use when implementing real-time sync between SQLite and backend databases (Postgres, MongoDB, MySQL, SQL Server). Covers schema definition, database setup, CRUD operations, React/Vue hooks, watch queries, and Kysely/Drizzle ORM integration.

PowerSync TypeScript Skill

Sync engine for local-first apps with real-time sync between client SQLite and backend databases.

When to Use

  • Offline-first/local-first applications
  • Real-time sync between client and server
  • Instant UI responsiveness with background sync

Installation

PlatformPackage
Web@powersync/web + @journeyapps/wa-sqlite
React Native@powersync/react-native + @powersync/op-sqlite
React hooks@powersync/react
Vue composables@powersync/vue
Node.js@powersync/node
Kysely ORM@powersync/kysely-driver
Drizzle ORM@powersync/drizzle-driver

Core Setup

  1. Schemadocs · example
  2. Databasedocs · example
  3. Connectordocs · example

API Quick Reference

OperationMethod
Get onedb.get(sql, params) / db.getOptional(sql, params)
Get alldb.getAll(sql, params)
Executedb.execute(sql, params)
Transactiondb.writeTransaction(async (tx) => { ... })
Watchdb.query({sql, parameters}).watch()
Diff watchdb.query({sql, parameters}).differentialWatch()

Full CRUD: docs

React Hooks

HookPurpose
useQueryQuery with loading/error states
useSuspenseQueryQuery with Suspense
useStatusConnection status
usePowerSyncDatabase instance

Docs: React · Vue

ORM Integration

ORMDocsExample
Kyselydocssource
Drizzledocssource
TanStack DBdocsdemo

Documentation

TopicURL
Overviewhttps://docs.powersync.com/intro/powersync-overview.md
Web SDKhttps://docs.powersync.com/client-sdk-references/javascript-web.md
React Native SDKhttps://docs.powersync.com/client-sdk-references/react-native-and-expo.md
Sync Ruleshttps://docs.powersync.com/usage/sync-rules.md
Watch Querieshttps://docs.powersync.com/usage/use-case-examples/watch-queries.md
API Referencehttps://powersync-ja.github.io/powersync-js/web-sdk

Local References

  • references/sync-rules.md - Sync Rules configuration
  • references/examples.md - All official example projects

GitHub Source

powersync-ja/powersync-js

PackageDescription
commonShared core (schema, sync, types)
webWeb SDK
react-nativeReact Native SDK
nodeNode.js SDK
capacitorCapacitor SDK
reactReact hooks
vueVue composables
tanstack-react-queryTanStack Query integration
kysely-driverKysely ORM driver
drizzle-driverDrizzle ORM driver
attachmentsFile attachments helper
powersync-op-sqliteOP-SQLite adapter
adapter-sql-jsSQL.js adapter (Expo Go)