Skip to content
Open
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
2 changes: 2 additions & 0 deletions resources/usage-and-billing/usage-and-billing-faq.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,8 @@ Data hosted can temporarily spike during Sync Rule deployments and defragmentati
node dist/bin.js fetch-operations --raw --token your-jwt --endpoint https://12345.powersync.journeyapps.com
```

If you generate the token from a config that uses `!env PS_*` tags, the test-client reads them from your shell; pass `--env path/to/.env` to load them from a file instead.

This returns the individual operations for a user in JSON. Example response:

```bash
Expand Down
6 changes: 6 additions & 0 deletions snippets/dev-token-self-hosted-steps.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,12 @@
node dist/bin.js generate-token --config path/to/service.yaml --sub test-user
```

If your config uses `!env PS_*` tags to reference environment variables, the test-client reads them from your shell. To load them from a file instead, pass `--env`:

```bash
node dist/bin.js generate-token --config path/to/service.yaml --env path/to/.env --sub test-user
```

Replace `test-user` with the user ID you want to authenticate:
- If your Sync Streams aren't filtered by user (same data syncs to all users), you can use any value (e.g., `test-user`).
- If your data is filtered by <Tooltip tip="Values such as user ID that are used to determine which data syncs to which user.">parameters</Tooltip>, use a user ID that matches a user in your database. PowerSync uses this value (e.g. via `auth.user_id()`) to determine what to sync.
Expand Down