The next step after configuring your database and connecting it to your PowerSync instance, is to include the appropriate PowerSync Client SDK package in your app project. On a high level, this involves the following steps:
For async iterator support with watched queries additional polyfills are required. See the Babel plugins section in the README.
By default, this SDK connects to a PowerSync instance via WebSocket (from @powersync/react-native@1.11.0) or HTTP Streaming (before @powersync/react-native@1.11.0). See Developer Notes for more details on connection methods and platform-specific requirements.
See the full SDK reference for further details and getting started instructions:
This SDK currently requires @journeyapps/wa-sqlite as a peer dependency. Install it in your app with:
npminstall @journeyapps/wa-sqlite
npminstall @journeyapps/wa-sqlite
yarnadd @journeyapps/wa-sqlite
pnpminstall @journeyapps/wa-sqlite
By default, this SDK connects to a PowerSync instance via WebSocket (from @powersync/web@1.6.0) or HTTP stream (before @powersync/web@1.6.0). See Developer Notes for more details on connection methods.
See the full SDK reference for further details and getting started instructions:
Add the PowerSync SDK to your project by adding the following to your build.gradle.kts file:
kotlin {//...sourceSets{ commonMain.dependencies{api("com.powersync:core:$powersyncVersion")// If you want to use the Supabase Connector, also add the following:implementation("com.powersync:connectors:$powersyncVersion")}//...}}
Cocoapods configuration (recommended for iOS)
Add the following to the cocoapods config in your build.gradle.kts:
The better-sqlite package requires native compilation, which depends on certain system tools. This compilation process is handled by node-gyp and may fail if required dependencies are missing or misconfigured.