You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PowerSync is a service and set of SDKs that keeps Postgres databases in sync with on-device SQLite databases.
5
+
_Bad connectivity is everywhere, and we're tired of it. PowerSync is on a mission to help developers write offline-first real-time reactive apps._
6
+
7
+
[PowerSync](https://powersync.com) is a service and set of SDKs that keeps Postgres databases in sync with on-device SQLite databases.
6
8
7
9
# PowerSync JavaScript SDKs
8
10
@@ -27,7 +29,7 @@ PowerSync is a service and set of SDKs that keeps Postgres databases in sync wit
27
29
28
30
## Demo Apps / Example Projects
29
31
30
-
Demo applications are located in the [`demos/`](./demos/) directory.
32
+
Demo applications are located in the [`demos/`](./demos/) directory. Also see our [Demo Apps / Example Projects gallery](https://docs.powersync.com/resources/demo-apps-example-projects), which lists all projects by the backend and client-side framework they use.
31
33
32
34
-[demos/nextjs-supabase-todolist](./demos/nextjs-supabase-todolist/): A Next.js to-do list example app using the PowerSync Web SDK and a Supabase backend.
33
35
-[demos/yjs-nextjs-supabase-text-collab](./demos/yjs-nextjs-supabase-text-collab/README.md): A Next.js real-time text editing collaboration example app powered by [Yjs](https://github.com/yjs/yjs) CRDTs and [Tiptap](https://tiptap.dev/), using the PowerSync Web SDK and a Supabase backend.
This package contains pure TypeScript common functionality for the PowerSync SDK.
3
+
This package contains a TypeScript implementation of a PowerSync database connector and streaming sync bucket implementation, which is used in the following SDKs:
[PowerSync](https://powersync.co) is a service and set of SDKs that keeps Postgres databases in sync with on-device SQLite databases. See a summary of features [here](https://docs.powersync.co/client-sdk-references/react-native-and-expo).
7
+
[PowerSync](https://powersync.com) is a service and set of SDKs that keeps Postgres databases in sync with on-device SQLite databases.
8
+
9
+
This package ([packages/powersync-sdk-react-native](./packages/powersync-sdk-react-native/README.md)) is the PowerSync SDk for React Native clients. It is an extension of `packages/powersync-sdk-common`.
10
+
11
+
See a summary of features [here](https://docs.powersync.co/client-sdk-references/react-native-and-expo).
4
12
5
13
# Installation
6
14
@@ -90,6 +98,16 @@ npx expo run:android
90
98
npx expo run:ios
91
99
```
92
100
93
-
# Learn More
101
+
# Getting Started
102
+
103
+
Our [SDK reference](https://docs.powersync.com/client-sdk-references/react-native-and-expo) contains everything you need to know to get started implementing PowerSync in your project.
104
+
105
+
# Examples
106
+
107
+
For example projects built with PowerSync and React Native, see our [Demo Apps / Example Projects](https://docs.powersync.com/resources/demo-apps-example-projects#react-native-and-expo) gallery.
108
+
109
+
# Found a bug or need help?
94
110
95
-
Refer to our [full documentation](https://docs.powersync.com/client-sdk-references/react-native-and-expo) to learn more.
111
+
* Join our [Discord server](https://discord.gg/powersync) where you can browse topics from our community, ask questions, share feedback, or just say hello :)
112
+
* Please open a [GitHub issue](https://github.com/powersync-ja/powersync-js/issues) when you come across a bug.
113
+
* Have feedback or an idea? [Submit an idea](https://roadmap.powersync.com/tabs/5-roadmap/submit-idea) via our public roadmap or [schedule a chat](https://calendly.com/powersync-product/powersync-chat) with someone from our product team.
[PowerSync](https://powersync.co) is a service and set of SDKs that keeps Postgres databases in sync with on-device SQLite databases.
7
+
[PowerSync](https://powersync.com) is a service and set of SDKs that keeps Postgres databases in sync with on-device SQLite databases.
8
+
9
+
This package ([packages/powersync-sdk-web](./packages/powersync-sdk-web/README.md)) is the PowerSync SDK for JavaScript Web clients. It is an extension of `packages/powersync-sdk-common`.
10
+
11
+
See a summary of features [here](https://docs.powersync.com/client-sdk-references/js-web).
4
12
5
13
## Beta Release
6
14
@@ -24,114 +32,18 @@ Install it in your app with:
24
32
npm install @journeyapps/wa-sqlite
25
33
```
26
34
27
-
## Logging
28
-
29
-
This package uses [js-logger](https://www.npmjs.com/package/js-logger) for logging.
30
-
31
-
Enable JS Logger with your logging interface of choice or use the default `console`
32
-
33
-
```JavaScript
34
-
importLoggerfrom'js-logger';
35
-
36
-
// Log messages will be written to the window's console.
37
-
Logger.useDefaults();
38
-
```
39
-
40
-
Enable verbose output in the developer tools for detailed logs.
41
-
42
-
The WASQLite DB Adapter opens SQLite connections inside a shared webworker. This worker can be inspected in Chrome by accessing
43
-
44
-
```
45
-
chrome://inspect/#workers
46
-
```
47
-
48
35
# Getting Started
49
36
50
-
See our [Docs](https://docs.powersync.co/usage/installation/client-side-setup) for detailed instructions.
// This is disabled once CSR+SSR functionality is verified to be working correctly
73
-
disableSSRWarning:true,
74
-
}}).getInstance();
75
-
76
-
awaitPowerSync.init();
77
-
78
-
// Run local statements.
79
-
awaitPowerSync.execute('INSERT INTO customers(id, name) VALUES(uuid(), ?)', ['Fred']);
80
-
};
81
-
82
-
classConnector {
83
-
asyncfetchCredentials() {
84
-
// TODO logic to fetch a session
85
-
return {
86
-
endpoint:'[The PowerSync instance URL]',
87
-
token:'An authentication token',
88
-
expiresAt:'When the token expires',
89
-
};
90
-
}
91
-
92
-
asyncuploadData(database) {
93
-
// Upload local changes to backend, see docs for example
94
-
}
95
-
}
96
-
97
-
exportconstconnectPowerSync=async () => {
98
-
constconnector=newConnector(); // Which was declared above
99
-
awaitPowerSync.connect(connector);
100
-
};
101
-
102
-
```
103
-
104
-
React hooks are available in the [@journeyapps/powersync-react](https://www.npmjs.com/package/@journeyapps/powersync-react) package
37
+
Our [full SDK reference](https://docs.powersync.com/client-sdk-references/js-web) contains everything you need to know to get started implementing PowerSync in your project.
105
38
106
-
## Multiple Tab Support
39
+
#Examples
107
40
108
-
Using PowerSync between multiple tabs is supported on some web browsers. Multiple tab support relies on shared web workers for DB and sync streaming operations. When enabled shared web workers named `shared-sync-[dbFileName]` and `shared-DB-worker-[dbFileName]` will be created.
41
+
For example projects built with PowerSync on Web, see our [Demo Apps / Example Projects](https://docs.powersync.com/resources/demo-apps-example-projects#js-web) gallery.
109
42
110
-
The shared database worker will ensure writes to the DB will instantly be available between tabs.
43
+
# Found a bug or need help?
111
44
112
-
The shared sync worker will co-ordinate for one active tab to connect to the PowerSync instance and share the latest sync state between tabs.
113
-
114
-
Currently using the SDK in multiple tabs without enabling the `enableMultiTabs` flag will spawn a standard web worker per tab for DB operations. These workers are safe to operate on the DB concurrently, however changes from one tab may not update watches on other tabs. Only one tab can sync from the PowerSync instance at a time. The sync status will not be shared between tabs, only the oldest tab will connect and display the latest sync status.
115
-
116
-
Multiple tab support is not currently available on Android or Safari.
117
-
118
-
Support is enabled by default if available. This can be disabled as below:
// This is disabled once CSR+SSR functionality is verified to be working correctly
126
-
disableSSRWarning:true,
127
-
/**
128
-
* Multiple tab support is enabled by default if available. This can be disabled by
129
-
* setting this flag to false.
130
-
*/
131
-
enableMultiTabs:false
132
-
}}).getInstance();
133
-
```
45
+
* Join our [Discord server](https://discord.gg/powersync) where you can browse topics from our community, ask questions, share feedback, or just say hello :)
46
+
* Please open a [GitHub issue](https://github.com/powersync-ja/powersync-js/issues) when you come across a bug.
47
+
* Have feedback or an idea? [Submit an idea](https://roadmap.powersync.com/tabs/5-roadmap/submit-idea) via our public roadmap or [schedule a chat](https://calendly.com/powersync-product/powersync-chat) with someone from our product team.
134
48
135
-
## Demo Apps
136
49
137
-
See the [list of demo apps](https://github.com/powersync-ja/powersync-web-sdk/?tab=readme-ov-file#demos) in the repo README.
0 commit comments