JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 65
  • Score
    100M100P100Q86049F
  • License MIT

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.

Package Exports

  • @alpha-sdk/api

Readme

@alpha-sdk/api

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 class for embedding the server lifecycle in your app.

This package is mostly a CLI. For HTTP / SSE / WebSocket calls against the running server, use the language-specific REST clients:

Language Package Repo
TypeScript @alpha-sdk/client npm
Python alpha-sdk-client PyPI
Swift AlphaSDK https://github.com/jordlee/alpha-sdk-swift

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>  # install Camera Help Guides 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

Talking to the running server

Pair ServerManager with @alpha-sdk/client:

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()}`,
});

const cameras = await client.cameras.list();
console.log(cameras);

await server.stop();

For SSE events, live view streaming, discovery + reconnect, and other non-REST patterns, see the recipes in this repo's docs/recipes/ folder.


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.