SNA

Core SDK

Runtime, server, launcher, and configuration surfaces for embedding SNA.

Core SDK

@sna-sdk/core is the lowest-level package. Use it when you run SNA inside another process, expose SNA through your own server, or need runtime-adapter primitives directly.

Core does not assume React and does not require the browser client. It owns the server-side runtime contract: configuration, runtime process lifecycle, HTTP/WS server assembly, SQLite-backed history, and launcher utilities for Node and Electron hosts.

Install

pnpm add @sna-sdk/core@0.17.2

Install better-sqlite3 in the host application as well. The package is a peer dependency because Electron apps often need a native binding rebuilt for their runtime.

Public surfaces

Import map

Import pathUse it for
@sna-sdk/coreRuntime helpers, shared types, configuration helpers, and runtime-neutral data shapes.
@sna-sdk/core/serverCreating the SNA HTTP app, attaching WebSocket support, and managing server-side sessions.
@sna-sdk/core/nodeStarting the standalone SNA server from a plain Node process.
@sna-sdk/core/electronStarting SNA from Electron, including packaged app path handling and in-process mode.
@sna-sdk/core/db/schemaDatabase schema helpers for hosts that need direct migration or inspection access.
@sna-sdk/core/providersAdvanced runtime-adapter primitives. Most applications should prefer the server or client APIs.

When to choose Core

Choose Core when the host owns the local server lifecycle. Typical examples are desktop apps, internal CLIs, test harnesses, and custom backend processes that need to expose SNA over their own HTTP server.

Use @sna-sdk/client when a server is already running and you only need typed HTTP, WebSocket, and SSE access. Use @sna-sdk/react when the integration lives inside a React UI.

On this page