Skip to content
Merged
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
6 changes: 6 additions & 0 deletions usage/sync-rules/advanced-topics/client-parameters.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ PowerSync already supports using **token parameters** in parameter queries. An e

**Client parameters** are specified directly by the client (i.e. not through the JWT authentication token). The advantage of client parameters is that they give client-side control over what data to sync, and can therefore be used to further filter or limit synced data. A common use case is [lazy-loading](/usage/use-case-examples/infinite-scrolling#2-control-data-sync-using-client-parameters), where data is split into pages and a client parameter can be used to specify which page(s) to sync to a user, and this can update dynamically as the user paginates (or reaches the end of an infinite-scrolling feed).

<Note>
[Sync Streams](/usage/sync-streams) make it easier to use client parameters, especially for apps where parameters are managed across different UI components and tabs.

For new apps that require client parameters, we recommend using [Sync Streams](/usage/sync-streams) (Early Alpha).
</Note>

### Usage

Client parameters are defined when [instantiating the PowerSync database](/installation/client-side-setup/instantiate-powersync-database), within the options of PowerSync's `connect()` method:
Expand Down