Skip to content

Commit

Permalink
Update readme in demo project
Browse files Browse the repository at this point in the history
  • Loading branch information
simolus3 committed Mar 5, 2025
1 parent 12c6649 commit a6e697b
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions demos/example-node/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,18 @@

This demonstrates a small NodeJS client opening a database and connecting PowerSync.

To get started, set up a PowerSync service instance with the default rules for the todolist examples.
Create a development token, and use it to implement `DemoConnector.fetchCredentials` in `main.ts`.
To get started with this example, you need a configured instance of the sync service.
This example expects the the schema [created in this guide](https://docs.powersync.com/integration-guides/supabase-+-powersync#configuring-powersync),
which you can follow to start a compatible service.

Then, use `pnpm run start` to open a database, connect to PowerSync, wait for a first sync, and run a simple query.
Being a simple CLI program, this currently doesn't implement authentication. So, you'll need to
create a [development token](https://docs.powersync.com/installation/authentication-setup/development-tokens#development-tokens) to run this example.
This demo expects the URL of the PowerSync instance in the `DEMO_ENDPOINT` environment variable,
the development token is read from `DEMO_TOKEN`.

Once you have those values ready, you can use the following command to open a database, connect to PowerSync,
wait for a first sync and run a simple query.

```
DEMO_ENDPOINT=https://yourinstance.powersync.journeyapps.com DEMO_TOKEN=YOURTOKEN pnpm run start
```

0 comments on commit a6e697b

Please sign in to comment.