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

@alpha-sdk/api

v1.0.9

Published

Server launcher and CLI for the Alpha Camera REST API. Spawns the bundled native binary (Sony Camera Remote SDK) and exposes a Node.js ServerManager for embedding the server in your app.

Readme

@alpha-sdk/api

The Alpha Camera REST API for Sony cameras (powered by the Sony Camera Remote SDK). This package ships the server itself — a native HTTP + SSE + WebSocket binary — bundled with three ways to drive it:

  • As an embedded server in any Node.js app via the ServerManager class.
  • As a standalone CLI (camera-server start) for one-off scripting or as a sidecar in Electron / Tauri / Pi deployments.
  • As an interactive playground (camera-server playground start) — a browser UI for exploring the API live, no client SDK required.

Pair it with one of the language-specific REST clients to call the API from your code:

| Language | Package | Install | |---|---|---| | TypeScript | @alpha-sdk/client | npm install @alpha-sdk/client | | Python | alpha-sdk-client | pip install alpha-sdk-client | | Swift | AlphaSDK | .package(url: "https://github.com/jordlee/alpha-sdk-swift.git", from: "0.3.1") |

Public example apps:


Install

# CLI globally — the most common path
npm install -g @alpha-sdk/api

# Or per-project (for ServerManager + bundling in your app)
npm install @alpha-sdk/api

The matching platform binary (@alpha-sdk/darwin-arm64, @alpha-sdk/linux-arm64, @alpha-sdk/linux-x64, @alpha-sdk/win32-x64) is pulled in automatically as an optionalDependency. No separate download step.


CLI usage

camera-server start            # spawn the server on :8080
camera-server stop
camera-server status

camera-server info             # version, platform, paths
camera-server doctor           # verify prerequisites
camera-server platforms        # list installed/available platforms

camera-server install-sdk ts       # add @alpha-sdk/client to current project
camera-server install-sdk python   # add alpha-sdk-client
camera-server install-sdk swift    # print SwiftPM snippet for Package.swift
camera-server install-sdk all      # auto-detect each project type and install

camera-server playground start     # interactive web playground
camera-server mcp install <agent> <scope> web-api  # install REST API docs MCP server

Programmatic usage (ServerManager)

import { ServerManager } from "@alpha-sdk/api";

const server = new ServerManager();
await server.start();             // resolves once HTTP is responsive
console.log(`server on :${server.getPort()}`);

// ... do stuff against http://localhost:${port}/api ...

await server.stop();              // graceful shutdown via /api/server/shutdown

Options

new ServerManager({
  port: 8080,           // default 8080
  binaryPath: "...",    // override auto-detect (rare)
  autoPort: true,       // find a free port if 8080 is taken
  detached: false,      // server outlives parent process
});

Useful methods

server.start();         // async — resolves when /api/server/status responds
server.stop();          // async — graceful → SIGTERM → SIGKILL escalation
server.kill();          // sync — for use in signal handlers
server.isRunning();     // async — pings /api/server/status
server.getPort();       // current port
server.getPid();        // child process PID (or detached PID)
server.getStdout();     // captured stdout lines
server.getStderr();     // captured stderr lines

End-to-end example

Pair ServerManager with @alpha-sdk/client — start the server, connect to a camera, change a setting, fire the shutter, list and download the resulting photo, then disconnect:

import { ServerManager } from "@alpha-sdk/api";
import { AlphaSDKClient } from "@alpha-sdk/client";

const server = new ServerManager();
await server.start();

const client = new AlphaSDKClient({
  environment: `http://localhost:${server.getPort()}`,
});

// 1. List + connect to the first detected camera
const { cameras } = await client.cameras.list();
const camera = cameras.find(c => c.connected !== true) ?? cameras[0];
const cameraId = camera.id;

await client.cameras.connect({
  cameraId,
  mode: "remote-transfer",   // full control + explicit file fetch
  reconnecting: "on",
});

// Required for the host to drive most settings
await client.properties.setPriorityKey({ cameraId, setting: "pc-remote" });

// 2. Change shutter speed
await client.properties.set({
  cameraId,
  propertyName: "shutter-speed",
  value: "1/250",
});

// 3. Take a photo
await client.actions.shutter({ cameraId });

// 4. Wait briefly for the camera to write the file, then list slot 1
await new Promise(r => setTimeout(r, 1500));
const { files } = await client.sdCard.list({ cameraId, slotNumber: 1 });
const latest = files[files.length - 1];

// 5. Download the photo to the host. Returns an AsyncOperationResponse —
//    the server pulls bytes from the camera in the background and writes to
//    the configured save path. Watch the `downloadComplete` SSE event for
//    the final file path (see docs/recipes for the SSE pattern).
await client.sdCard.download({
  cameraId,
  slotNumber: 1,
  contentId: latest.contentId,
  fileId: latest.fileId,
  body: {},
});

// 6. Clean up
await client.cameras.disconnect({ cameraId });
await server.stop();

That covers the most common flow. For SSE event streams, live-view JPEG polling/streaming, discovery + reconnect, multi-camera coordination, and other non-REST patterns, see the docs, the recipes, and the public example apps:


Integration modes

| App type | Pattern | What's bundled | |---|---|---| | Node CLI / script | ServerManager.start() | binary auto-installed via npm | | Electron | ServerManager + extraResources | binary copied into .app | | Tauri | sidecar | binary in src-tauri/binaries/ | | Web SPA | client only | nothing — server runs separately | | iOS / Android | client only | nothing — server runs on a Mac/Pi/etc. |

The binary cannot run on iOS/Android — those platforms must talk to a server running elsewhere on the network.


License

MIT — see LICENSE.

The bundled native binary is licensed by Sony under their separate Camera Remote SDK License Agreement; see the LICENSE file shipped inside each @alpha-sdk/<platform> package.