npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@samesight/verify

v0.1.0

Published

Catches PowerSync sync configs that send devices rows Supabase RLS refuses, by syncing headless devices on your local stack: audit and policy verification

Readme

@samesight/verify

PowerSync replicates with a role that bypasses Postgres row level security, so the sync config is the only filter between your tables and a device. When the sync config is wider than RLS, nothing fails: devices quietly hold rows their users may not read. This package finds those rows, against your local Supabase and PowerSync stack (audit mode can start its own PowerSync).

Audit a project with hand-written RLS and a hand-written sync config, with no Samesight policy. It needs the project's local Supabase stack and Docker. samesight audit, from the samesight CLI, forwards to samesight-verify audit:

npm install -D samesight @samesight/verify supabase
npx supabase start
npx samesight audit --project . --sync-config sync-config.yaml
# the same run: npx samesight-verify audit --project . --sync-config sync-config.yaml

samesight audit on the to-do list demo with a leak planted: it fails, names the stream query that sent another user's list, the RLS policy that refused it, and the filter to add

With a samesight policy, it checks that the generated RLS and sync streams agree:

npx samesight-verify            # static, catalog, differential, write path
npx samesight-verify --mutate   # and show the tests would catch a weakened rule

With a policy, it runs:

  1. Static checks: generated files match the policy, every stream query carries the tenant gate, the client schema covers every synced table, and PowerSync is 1.20.1 or newer.
  2. Catalog checks: RLS, policies, grants, anon reach, role bypasses, views, the token hook and the publication, plus a rolled-back re-apply of the generated migration that names any drift.
  3. Differential test: real users for every role, generated data (fast-check, shrunk on failure), a headless PowerSync device per user, and RLS reads with the same token. Every synced row must be one RLS returns, and every RLS row must sync.
  4. Write path: forged upload batches (other tenants, forged authors, append-only edits, protected columns, replays, self-promotion) must be refused.
  5. Mutation test (--mutate): each rule in the RLS and the sync config is weakened in turn, and the differential must catch every one.

Audit mode (samesight-verify audit) runs the catalog checks, the differential and a write check on any Supabase + PowerSync project, with no Samesight policy. It reads Edition 3 sync streams and legacy sync rules (bucket_definitions). It needs only supabase start and Docker: unless given --powersync, it starts a PowerSync service of its own for the run (the official FSL-licensed image, pulled once, never redistributed) and removes it, and everything it made, at the end (unless --keep-powersync keeps it for the next audit). Its run users hold the app_metadata values the rules compare (roles, an org id), and a Coverage section says which policies and streams were seen both allowing and refusing a row.

It refuses to run against anything but this machine: every address must be local, NODE_ENV must be development or test, and hosting platform variables must be absent. It reads addresses and keys from supabase status, using the Supabase CLI in node_modules/.bin or on your PATH. Needs Node 22.18 or newer, and Docker when audit starts PowerSync.

MIT