Use this runbook to validate local Papyrus auth, PowerSync JWT minting, upload handling, and two-client replication.
The sandbox writes to powersync_demo_items.
Set the PowerSync values in .env:
POWERSYNC_JWT_PRIVATE_KEY_FILE=.local/powersync/private.pem
POWERSYNC_JWT_PUBLIC_KEY_FILE=.local/powersync/public.pem
POWERSYNC_JWT_KEY_ID=papyrus-powersync-dev
POWERSYNC_JWT_AUDIENCE=powersync-dev
POWERSYNC_SERVICE_URL=http://localhost:8081
POWERSYNC_JWKS_URI=http://host.docker.internal:8080/v1/auth/jwks
POWERSYNC_SOURCE_ROLE=powersync_role
POWERSYNC_SOURCE_PASSWORD=powersync_dev_password
POWERSYNC_STORAGE_DB=powersync_storage
POWERSYNC_STORAGE_USER=powersync_storage_user
POWERSYNC_STORAGE_PASSWORD=powersync_storage_passwordRun from server/:
uv sync --extra dev
./scripts/bootstrap_local.sh
npm --prefix frontend/dev-pages install
npm --prefix frontend/dev-pages run devUse --host 0.0.0.0 so the PowerSync container reaches the JWKS endpoint at
host.docker.internal:8080.
- Sandbox:
http://localhost:8080/__dev/powersync-sandbox - Client one:
http://localhost:8080/__dev/powersync-sandbox?client=one - Client two:
http://localhost:8080/__dev/powersync-sandbox?client=two - Source snapshot:
http://localhost:8080/__dev/powersync-demo/items - PowerSync service:
http://localhost:8081 - Mailpit inbox:
http://localhost:8025
- Open
client=oneandclient=twoin separate tabs. - Register or log in as the same user in both tabs.
- Connect PowerSync in both tabs.
- Create a demo item in
client=one. - Confirm the item appears in
client=one, the source snapshot, andclient=two. - Update the item in
client=two. - Confirm the updated item appears in
client=one. - Delete the item.
- Confirm the item disappears from both clients and the source snapshot.
Passing validation proves:
- Papyrus login works.
POST /v1/auth/powersync-tokenreturns a usable PowerSync JWT.- PowerSync uploads reach Postgres.
- Replication delivers committed changes to another client.
Run from server/:
docker compose down -v
./scripts/bootstrap_local.sh
npm --prefix frontend/dev-pages run devClear browser storage for http://localhost:8080/__dev/powersync-sandbox.