@alpha-sdk/api is the npm distribution of the Alpha Camera REST API. A single install gives you three things:
- The native REST API server binary (
CameraWebApp) for macOS, Linux, and Windows.
- The
camera-server CLI for installing, starting, stopping, and inspecting the server.
- A small
ServerManager Node.js class for embedding the server lifecycle inside a Node application.
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.
ServerManager is a Node.js convenience class, not a separate SDK. Python and Swift clients do not ship a ServerManager equivalent. From those languages, run camera-server start, spawn the binary as a subprocess, or connect to a server already running elsewhere on the network.
Install
# Globally — CLI / scripting
npm install -g @alpha-sdk/api
# Per-project — when embedding ServerManager
npm install @alpha-sdk/api
After install, the Sony Camera Remote SDK License Agreement prompt appears once. Accept it to unlock the binary.
CLI
camera-server start # spawn the server on :8080
camera-server stop
camera-server status # check what's running
camera-server info # version, platform, binary path
camera-server doctor # verify prerequisites
camera-server platforms # list installed/available platforms
camera-server install-sdk ts # install @alpha-sdk/client in current project
camera-server install-sdk python # install alpha-sdk-client
camera-server install-sdk swift # print SwiftPM snippet
camera-server install-sdk all # install all three
camera-server playground start # browser-based interactive playground
camera-server mcp install <agent> # install Camera Help Guides MCP server
camera-server docs # open https://crsdk.app
Run camera-server with no arguments to launch the interactive TUI.
ServerManager (Node.js)
A small class for embedding the server lifecycle inside a Node, Electron, or Tauri application.
import { ServerManager } from "@alpha-sdk/api";
const server = new ServerManager();
await server.start();
console.log(`server on :${server.getPort()}`);
// ... do work against http://localhost:${server.getPort()}/api ...
await server.stop();
Constructor options
new ServerManager({
port: 8080,
binaryPath: "...",
autoPort: true,
detached: false,
});
Methods
| Method | Description |
|---|
start() → Promise<void> | Spawn the binary. Resolves when /api/server/status responds 200. |
stop() → Promise<void> | Graceful shutdown. Falls back to SIGTERM → SIGKILL if the binary does not exit. |
kill() → void | Synchronous no-fallback kill. Useful inside signal handlers. |
isRunning() → Promise<boolean> | Pings /api/server/status. |
getPort() → number | Currently bound port. |
getPid() → number | undefined | Child process PID or detached PID. |
getStdout() → string[] | Captured stdout lines. |
getStderr() → string[] | Captured stderr lines. |
End-to-end example
Pair ServerManager with the TypeScript Client SDK — 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()}`,
});
const { cameras } = await client.cameras.list();
const cameraId = cameras[0].id;
await client.cameras.connect({
cameraId,
mode: "remote-transfer",
reconnecting: "on",
});
await client.properties.setPriorityKey({ cameraId, setting: "pc-remote" });
await client.properties.set({ cameraId, propertyName: "shutter-speed", value: "1/250" });
await client.actions.shutter({ cameraId });
await new Promise(r => setTimeout(r, 1500));
const { files } = await client.sdCard.list({ cameraId, slotNumber: 1 });
const latest = files[files.length - 1];
await client.sdCard.download({
cameraId,
slotNumber: 1,
contentId: latest.contentId,
fileId: latest.fileId,
body: {},
});
await client.cameras.disconnect({ cameraId });
await server.stop();
Integration patterns
| Application type | Pattern | Bundling |
|---|
| Node CLI / script | ServerManager.start() | Binary auto-installed via npm. |
| Electron | ServerManager + extraResources | Binary copied into the app bundle. |
| Tauri | Sidecar | Binary in src-tauri/binaries/. |
| Browser-only SPA | Talk to a server running elsewhere | Nothing bundled. |
| iOS / Android | Talk to a server running elsewhere | Nothing bundled. |
| Python / Swift / other languages | Spawn the binary as a subprocess, or run camera-server start separately | See the server subprocess example. |
Health and control endpoints
For TypeScript projects, use ServerManager plus the published client and example patterns instead of calling these endpoints directly in application code.
See the auto-generated API reference for full request and response schemas.
Server status
GET /api/server/status returns server version, uptime, platform, and camera counts. ServerManager uses this endpoint to confirm the server is ready.
curl http://localhost:8080/api/server/status
Server logs
GET /api/server/logs returns buffered server log output. Query params: lines (default 100), level (default info).
curl http://localhost:8080/api/server/logs
Shutdown
POST /api/server/shutdown initiates graceful shutdown: disconnects all cameras, closes open SSE streams, then exits. ServerManager.stop() calls this before falling back to SIGTERM.
curl -X POST http://localhost:8080/api/server/shutdown
Embedding in Electron or Tauri
The bundled binary lives at node_modules/@alpha-sdk/<platform>/CameraWebApp (or CameraWebApp.exe on Windows).
Electron-builder
{
"build": {
"extraResources": [
{
"from": "node_modules/@alpha-sdk/${platform}-${arch}",
"to": "alpha-sdk-binary",
"filter": ["**/*"]
}
]
}
}
Then in your main process:
import path from "node:path";
import { ServerManager } from "@alpha-sdk/api";
const server = new ServerManager({
binaryPath: path.join(
process.resourcesPath,
"alpha-sdk-binary",
process.platform === "win32" ? "CameraWebApp.exe" : "CameraWebApp"
),
});
await server.start();
Tauri
Drop the binary into src-tauri/binaries/CameraWebApp-<triple> and declare it as a sidecar in tauri.conf.json:
{
"tauri": {
"bundle": {
"externalBin": ["binaries/CameraWebApp"]
}
}
}
Versioning
@alpha-sdk/api follows SemVer.
- Patch — bug fixes, bundled-binary updates, playground bundle refreshes.
- Minor — new CLI commands, new
ServerManager methods.
- Major — breaking changes to the CLI surface or
ServerManager API.