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

@privateconnect/sdk

v0.8.7

Published

Define your connections in pconnect.yml. Access them from anywhere.

Readme

Private Connect SDK

Define your connections in pconnect.yml. Access them from anywhere — your app, CI, an AI agent.

Install

npm install @privateconnect/sdk

Quick Start

1. Create pconnect.yml in your project root:

resources:
  staging-db:
    type: postgres
    host: internal-db
    port: 5432
    access:
      mode: tcp
  redis-cache:
    type: redis
    host: redis.internal
    port: 6379
    access:
      mode: tcp

2. Use it in your code:

import { PrivateConnect } from '@privateconnect/sdk';

const pc = PrivateConnect.fromManifest();

const db = pc.resource('staging-db');
console.log(db.connectionString); // postgres://internal-db:5432
console.log(db.envVar);           // DATABASE_URL

const cache = pc.resource('redis-cache');
console.log(cache.connectionString); // redis://redis.internal:6379

3. Run connect dev to make it live:

connect dev
# → Provisions tunnels for every resource in pconnect.yml
# → Your app's connection strings now resolve to live services

That's it. Your app declares what it connects to. connect dev makes it work. An AI agent (or a teammate) can modify pconnect.yml to change the topology — without touching application code.

Why This Matters

The pconnect.yml file is a diffable, reviewable, mergeable description of your project's connectivity. When an AI modifies it — adding a read replica, changing a TTL, switching an access mode — that's a PR you can review and merge. The SDK reads the manifest; the agent provisions it.

Manifest API

PrivateConnect.fromManifest(path?, config?)

Load a manifest and return a configured client. Auto-discovers pconnect.yml in the current directory (or parents) if no path is given.

// Auto-discover
const pc = PrivateConnect.fromManifest();

// Explicit path
const pc = PrivateConnect.fromManifest('./infra/pconnect.yml');

// With hub API access (for grants, orchestration, etc.)
const pc = PrivateConnect.fromManifest('./pconnect.yml', {
  apiKey: process.env.PRIVATECONNECT_API_KEY,
});

pc.resource(name)

Get a resource by name. Returns its resolved type, host, port, connection string, and suggested environment variable.

const db = pc.resource('staging-db');
// {
//   name: 'staging-db',
//   type: 'postgres',
//   host: 'internal-db',
//   port: 5432,
//   connectionString: 'postgres://internal-db:5432',
//   envVar: 'DATABASE_URL',
//   accessMode: 'tcp',
//   via: 'direct'
// }

pc.resources()

List all resources declared in the manifest.

const all = pc.resources();
all.forEach(r => console.log(`${r.name}: ${r.connectionString}`));

pc.envBlock()

Generate a .env-compatible block for all resources.

console.log(pc.envBlock());
// DATABASE_URL=postgres://internal-db:5432
// REDIS_URL=redis://redis.internal:6379
// API_URL=http://payments.service.internal:3000

Hub API

When you pass an API key, you also get access to the hub APIs for grants, agents, and services.

Grants

Grant an AI agent temporary, scoped access to a private resource.

const pc = PrivateConnect.fromManifest('./pconnect.yml', {
  apiKey: process.env.PRIVATECONNECT_API_KEY,
});

const grant = await pc.grants.create({
  agentLabel: 'claude',
  resourceType: 'db',
  resourceName: 'postgres',
  ttl: '5m',
});
console.log(grant.token); // gnt_...

Agent Orchestration

Coordinate agents across machines.

const agents = await pc.agents.list({ onlineOnly: true });
const gpuAgents = await pc.agents.findByCapability('gpu');

await pc.agents.sendMessage(gpuAgents[0].id, {
  action: 'run-training',
  dataset: 'v2',
});

Services

Query hub-registered services directly.

const services = await pc.services.list();
const conn = await pc.connect('prod-db');
console.log(conn.connectionString);

Manifest Format

The pconnect.yml file supports the following resource types:

| Type | Default Port | Connection String | Env Var | |------|-------------|-------------------|---------| | postgres | 5432 | postgres://host:port | DATABASE_URL | | mysql | 3306 | mysql://host:port | DATABASE_URL | | redis | 6379 | redis://host:port | REDIS_URL | | http | 80 | http://host:port | API_URL | | generic-tcp | — | tcp://host:port | <NAME>_URL |

Access modes:

  • tcp — direct TCP tunnel (databases, Redis, generic)
  • http — HTTP-level proxying

Transport:

  • direct (default) — connect directly to the target
  • hub — route through the Private Connect hub when the target isn't directly reachable

Environment Variables

| Variable | Purpose | |----------|---------| | PRIVATECONNECT_API_KEY | API key for hub access (grants, orchestration) | | CONNECT_HUB_URL | Hub URL (default: https://api.privateconnect.co) |

License

FSL-1.1-MIT