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

@webdevicecable/relay

v0.2.7

Published

WebDeviceCable relay client for Node backends and dynamic project provisioning

Readme

@webdevicecable/relay

Node backend client for a self-hosted WebDeviceCable (WDC) relay. Zero runtime dependencies. Requires Node.js 22+. CommonJS, ESM and TypeScript declarations are included; both module entries share the same runtime and error classes.

TypeScript backend projects should install @types/node as a development dependency. Browser DOM declarations are not required.

The relay forwards requests to the user's paired desktop over its outbound connection. Native execution and provider credentials stay on the desktop. The relay server ships separately as Docker. This package must stay on the backend.

Install

npm install --save-exact @webdevicecable/[email protected]
import { RelayClient, RelayAdminClient, relayConnectURL, relaySettingsURL } from '@webdevicecable/relay';
const { RelayClient, RelayAdminClient } = require('@webdevicecable/relay');

Use the local .tgz artifact before the first npm publication. Neither installation requires a WDC source checkout or the browser package.

Register each website

const admin = new RelayAdminClient({
  baseURL: process.env.WDC_RELAY_URL,
  adminKey: process.env.WDC_ADMIN_KEY,
});
const { project, apiKey } = await admin.createProject({
  appId: 'writer.example', name: 'Writer', origin: 'https://writer.example',
});
// Save apiKey in that website's backend secret store; it is returned only once.

Keep the operator credential in the provisioning service. Give each website only its own project credential. Registration works for one website or many and requires no relay restart. A registered project cannot grant desktop permissions.

Pair an authenticated account

const enrollment = await RelayClient.enroll({
  baseURL: process.env.WDC_RELAY_URL,
  apiKey: process.env.WDC_PROJECT_KEY,
  appUser: String(authenticatedUser.id),
});
const launchUrl = relayConnectURL({baseURL: process.env.WDC_RELAY_URL, code: enrollment.code});
// Return launchUrl only to this authenticated account. It opens local approval.
// Keep code + URL under a manual fallback if the installed app cannot open.
// After local approval, retain its connection ID on the backend.

relaySettingsURL({baseURL, connectionId}) reopens the paired connection's local program settings. Keep pending pairing separate from the active device until approval. status() distinguishes pending, declined and expired enrollment; a lost device remains paired until explicitly disconnected.

Workflow groups support independent program, model and reasoning choices in WDC. Use minimumRoutingVersion: 2 to require the updated desktop; model choices and native credentials stay local. SDK 0.2.0 also requires desktop and relay scopedToolsVersion:1; upgrade both transports together.

Pass app tools to a continuing session({tools}) or standalone submit, run, and preflight, never client construction. Sessions retain immutable definitions and handlers. New tools require an explicit new session with saved history; simultaneous executions can use different definitions for the same IDs.

See RELAY.md for the complete pairing flow, RelayClient construction, groups, jobs, streaming, sessions, files, tool callbacks, provider-compatible routes and recovery. Your backend owns authorization, operation IDs and output validation. Never automatically replay an uncertain inference through another route.

The package does not include the Docker server or desktop application. For direct browser integration, use @webdevicecable/sdk. MIT licensed.

Named installations and profiles are chosen locally in WDC, per connection and workflow. Existing codex/claude IDs remain the default entries; generated program IDs identify additional installations. Check each selected entry's capabilities before submitting work. Custom harnesses require explicit local grants and do not inherit native isolation guarantees. See AI programs.

Version 0.2.1 adds optional logo/default-approval suggestions to enrollment and the same execution-scoped input-schema and operation-detail features as the browser SDK. Update the desktop and relay runtime together before deploying consumers of these features. Existing pairings and operation receipts are retained.

Version 0.2.2 adds explicit file permissions, bounded text context uploads and image/document tool results. Upgrade the desktop and relay runtime before using these features. Existing connections need the owner to enable Send and receive files. See the file permission guide.