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
@@ -31,7 +33,7 @@ PowerSync is a service and set of SDKs that keeps Postgres databases in sync wit
31
33
32
34
## Demo Apps / Example Projects
33
35
34
-
Demo applications are located in the [`demos/`](./demos/) directory.
36
+
Demo applications are located in the [`demos/`](./demos/) directory. Also see our [Demo Apps / Example Projects](https://docs.powersync.com/resources/demo-apps-example-projects) gallery which lists all projects by the backend and client-side framework they use.
35
37
36
38
-[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.
37
39
-[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`) 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
@@ -82,14 +90,32 @@ module.exports = function (api) {
82
90
83
91
# Native Projects
84
92
85
-
This package uses native libraries. Create native Android and iOS projects (if not created already) with
93
+
This package uses native libraries. Create native Android and iOS projects (if not created already) by running:
86
94
87
95
```bash
88
96
npx expo run:android
89
97
# OR
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
+
# Changelog
106
+
107
+
A changelog for this SDK is available [here](https://releases.powersync.com/announcements/react-native-client-sdk).
108
+
109
+
# API Reference
110
+
111
+
The full API reference for this SDK can be found [here](https://powersync-ja.github.io/powersync-js/react-native-sdk).
112
+
113
+
# Examples
114
+
115
+
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. Most of these projects can also be found in the [`demos/`](../demos/) directory.
116
+
117
+
# Found a bug or need help?
94
118
95
-
Refer to our [full documentation](https://docs.powersync.com/client-sdk-references/react-native-and-expo) to learn more.
119
+
* Join our [Discord server](https://discord.gg/powersync) where you can browse topics from our community, ask questions, share feedback, or just say hello :)
120
+
* Please open a [GitHub issue](https://github.com/powersync-ja/powersync-js/issues) when you come across a bug.
121
+
* 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.
// 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
-
};
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.
101
38
102
-
```
103
-
104
-
React hooks are available in the [@journeyapps/powersync-react](https://www.npmjs.com/package/@journeyapps/powersync-react) package
39
+
# Changelog
105
40
106
-
## Multiple Tab Support
41
+
A changelog for this SDK is available [here](https://releases.powersync.com/announcements/powersync-js-web-client-sdk).
107
42
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.
43
+
# API Reference
109
44
110
-
The shared database worker will ensure writes to the DB will instantly be available between tabs.
45
+
The full API reference for this SDK can be found [here](https://powersync-ja.github.io/powersync-js/web-sdk).
111
46
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.
47
+
# Examples
113
48
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.
49
+
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. Most of these projects can also be found in the [`demos/`](../demos/) directory.
115
50
116
-
Multiple tab support is not currently available on Android or Safari.
51
+
# Found a bug or need help?
117
52
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
-
```
53
+
* Join our [Discord server](https://discord.gg/powersync) where you can browse topics from our community, ask questions, share feedback, or just say hello :)
54
+
* Please open a [GitHub issue](https://github.com/powersync-ja/powersync-js/issues) when you come across a bug.
55
+
* 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
56
135
-
## Demo Apps
136
57
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