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

@bennettstudio/sdk

v0.5.0

Published

Bennett Studio SDK — query shared databases via P2P or relay

Readme

Markdown Copy Code Preview

@bennett/sdk

Query shared Bennett databases from any JavaScript environment.

Installation

npm install @bennett/sdk
Or via CDN:
HTML
<script type="module">
  import { BennettClient } from 'https://cdn.jsdelivr.net/npm/@bennett/sdk@latest/dist/index.esm.js';
</script>
Quick Start
TypeScript
import { BennettClient } from '@bennett/sdk';

// From a share URL
const client = await BennettClient.fromShareUrl(
  'https://share.bennett.studio/db/AG8VBEUASN?t=eyJ0eXAi...'
);

// Query
const result = await client.query('SELECT * FROM users LIMIT 10');
console.log(result.rows);

// Schema
const schema = await client.getSchema();
console.log(schema.tables);
Connection Modes
The SDK automatically selects the best connection:
Table
Mode	Latency	Requires
P2P	~5-20ms	WebRTC support, direct network path
Relay	~50-200ms	Internet access
Direct	~1-5ms	Same network
API Reference
BennettClient.fromShareUrl(url)
Create client from a Bennett share URL.
client.query(sql, limit?, offset?)
Execute a SELECT query.
client.write(sql, parameters?)
Execute INSERT/UPDATE/DELETE.
client.getSchema()
Fetch database schema.
client.getConnectionMode()
Returns 'p2p' | 'relay' | 'direct'.
client.close()
Clean up connections.
plain

---

## PHASE 5: WebRTC Bridge in Relay (Optional Advanced)

This phase is **optional** — the SDK P2P in Phase 2 already handles browser-to-engine direct. Only implement this if you want the relay to also bridge WebRTC.

Skip this for now. The current architecture works:
- **SDK P2P** → direct browser-to-engine WebRTC (bypasses relay entirely)
- **SDK fallback** → WebSocket to relay → engine TCP

---

## DEPLOYMENT CHECKLIST

After all find-and-replaces:

| Step | Command/Action | Verify |
|------|-------------|--------|
| 1. Build SDK | `cd shared/sdk/typescript && npm run build` | `dist/` folder created |
| 2. Publish SDK | `npm publish --access public` | `npm view @bennett/sdk` works |
| 3. Deploy relay | Push to GitHub → Render dashboard → New Web Service | `curl https://bennett-relay.onrender.com/health` |
| 4. Deploy web | `cd web && vercel --prod` | `https://share.bennett.studio/db/...` loads |
| 5. Test end-to-end | Create share → open URL → query | Results appear |

---

Run these find-and-replaces in order, create the new files, then deploy.