Skip to content
This repository has been archived by the owner on Feb 9, 2024. It is now read-only.

[Update] Readme #5

Merged
merged 7 commits into from
Nov 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/swift-chicken-smile.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@journeyapps/powersync-sdk-web': patch
---

Update package readme
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ pnpm install
pnpm build:packages
```

To run a demo app see [README](./demos/powersync-nextjs-demo/README.md)
To run a demo app follow the [getting started](./demos/powersync-nextjs-demo/README.md#getting-started) instructions.
19 changes: 12 additions & 7 deletions packages/powersync-sdk-web/README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# PowerSync SDK for Web

[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).
[PowerSync](https://powersync.co) is a service and set of SDKs that keeps Postgres databases in sync with on-device SQLite databases.

## Alpha Release
This React Native SDK package is currently in an alpha release.
This SDK package is currently in an alpha release.

# Installation

Expand All @@ -28,7 +28,7 @@ This package uses [js-logger](https://www.npmjs.com/package/js-logger) for loggi

Enable JS Logger with your logging interface of choice or use the default `console`
```JavaScript
import { Logger } from 'js-logger';
import Logger from 'js-logger';

// Log messages will be written to the window's console.
Logger.useDefaults();
Expand All @@ -51,7 +51,7 @@ See our [Docs](https://docs.powersync.co/usage/installation/client-side-setup) f
import {
Column,
ColumnType,
RNQSPowerSyncDatabaseOpenFactory,
WASQLitePowerSyncDatabaseOpenFactory,
Schema,
Table
} from '@journeyapps/powersync-sdk-web';
Expand All @@ -63,7 +63,7 @@ export const AppSchema = new Schema([
let PowerSync;

export const openDatabase = async () => {
const PowerSync = new WASQLitePowerSyncDatabaseOpenFactory({
PowerSync = new WASQLitePowerSyncDatabaseOpenFactory({
schema: AppSchema,
dbFilename: 'test.sqlite'
}).getInstance();
Expand All @@ -81,7 +81,6 @@ class Connector {
endpoint: '[The PowerSync instance URL]',
token: 'An authentication token',
expiresAt: 'When the token expires',
userID: 'User ID to associate the session with'
};
}

Expand All @@ -99,4 +98,10 @@ export const connectPowerSync = async () => {

React hooks are available in the [@journeyapps/powersync-react](https://www.npmjs.com/package/@journeyapps/powersync-react) package

Refer to our [full documentation](https://docs.powersync.co/client-sdk-references/react-native-and-expo) to learn more.

## Demo Apps

See our [NextJS Demo App](https://github.com/powersync-ja/powersync-web-sdk/tree/main/demos/powersync-nextjs-demo) for how to use this SDK with NextJS and Supabase.

# Known Issues
This initial SDK version uses a `SharedWorker` for DB operations which is not supported on Chrome for Android. Future SDK versions will feature selectable DB Adapters which will increase compatibility.
Loading