|
2 | 2 |
|
3 | 3 | This demonstrates a small NodeJS client opening a database and connecting PowerSync. |
4 | 4 |
|
5 | | -To get started with this example, you need a configured instance of the sync service. |
6 | | -This example expects the the schema [created in this guide](https://docs.powersync.com/integration-guides/supabase-+-powersync#configuring-powersync), |
7 | | -which you can follow to start a compatible service. |
| 5 | +To get started with this example, you need a configured instance of the PowerSync Service. The easiest way to get started is to configure a PowerSync Cloud instance, docs [here](https://docs.powersync.com/installation/database-connection#create-a-powersync-cloud-instance). |
| 6 | +This example expects the schema of our To-Do list example apps; ensure you deploy compatible Sync Rules to your instance which can be found [in our Supabase integration guide](https://docs.powersync.com/integration-guides/supabase-+-powersync#configure-sync-rules). |
8 | 7 |
|
9 | 8 | Being a simple CLI program, this currently doesn't implement authentication. So, you'll need to |
10 | 9 | create a [development token](https://docs.powersync.com/installation/authentication-setup/development-tokens#development-tokens) to run this example. |
11 | | -This demo expects the URL of the PowerSync instance in the `DEMO_ENDPOINT` environment variable, |
| 10 | +This demo expects the URL of your PowerSync instance (this can be copied from the PowerSync Dashboard) in the `DEMO_ENDPOINT` environment variable, |
12 | 11 | the development token is read from `DEMO_TOKEN`. |
13 | 12 |
|
14 | | -Once you have those values ready, you can use the following command to open a database, connect to PowerSync, |
15 | | -wait for a first sync and run a simple query. |
| 13 | +Once you have these ready: |
16 | 14 |
|
| 15 | +1. Make sure to run `pnpm install` and `pnpm build:packages` in the root of this repo. |
| 16 | +2. Then run the following, inserting your instance URL and developer token: |
| 17 | +```DEMO_ENDPOINT=https://yourinstance.powersync.journeyapps.com DEMO_TOKEN=YOURTOKEN pnpm run start |
17 | 18 | ``` |
18 | | -DEMO_ENDPOINT=https://yourinstance.powersync.journeyapps.com DEMO_TOKEN=YOURTOKEN pnpm run start |
19 | | -``` |
| 19 | +This opens the local database, connects to PowerSync, waits for a first sync and then runs a simple query. |
0 commit comments