Full SDK reference for using PowerSync in JavaScript Web clients
@journeyapps/wa-sqlite
as a peer dependency. Install it in your app with:
@powersync/web@1.6.0
) or HTTP streaming (before @powersync/web@1.6.0
). See Developer Notes for more details on connection methods.text
, integer
and real
. These should map directly to the values produced by the Sync Rules. If a value doesn’t match, it is cast automatically. For details on how Postgres types are mapped to the types below, see the section on Types in the Sync Rules documentation.
Example:
id
column, as PowerSync will automatically create this.null
if no result is found).
PowerSyncDatabase.connect()
method uses WebSocket. You can optionally specify the connectionMethod
to override this:
OPFSCoopSyncVFS
, but requires using WASQLiteVFS.AccessHandlePoolVFS
.VFS Type | Multi-Tab Support (Standard Browsers) | Multi-Tab Support (Safari/iOS) | Notes |
---|---|---|---|
IDBBatchAtomicVFS | ✅ | ❌ | Default, some Safari stability issues |
OPFSCoopSyncVFS | ✅ | ✅ | Recommended for multi-tab support |
AccessHandlePoolVFS | ❌ | ❌ | Best for single-tab applications |