userland.rundocs70Try the demo
SDK

API reference

Every public export of @userland-run/nano-sdk 0.2.10, grouped by area, with a link to the guide that documents and runs it. The bundled dist/index.d.ts has the exact signatures.

SDK · JavaScript

List the runtime exports

The value exports of the module this page loaded (types are compile-time only).

javascript
const names = Object.keys(sdk).sort();
print(names.length, "exports");
print(names.join(" "));
loading…
Expected output
35 exports
CATALOG_PUBLIC_KEY_B64 Catalog CdnClient Nano NanoWorkerClient NodeRuntime ScriptError ServeBridge Shell Vfs canonicalize catalogPublicKey createHeadless createNano createNanoWorker defaultGenerationStore ensureCrossOriginIsolated fetchVerifiedChunk installApp isWasmKind kindToTier manifestKind manifestTier nanoImage openChunkCache parseHttpResponse provision publicKeyFromB64 registerNanoServiceWorker resolveIndex resolveManifest sha256Hex startServer tokenize verifySigned

Core

Export
Kind
Guide
createNano(config)
function → Promise<Nano>
nanoImage(opts)
function → ImageConfig
Vfs
class (nano.fs)

Nano members

Member
Guide
run, exec, shExec, node
writeStdin, setInteractiveStdin, closeStdin, cancel, destroy
withVmLock, withVmServerLock, launchServer
resolveNodeEngine
fs, raw, readText
shell()
nodeRuntime()
script(), scripting()
virtualServer, injectConnection, listeners
catalog(), installApp, installBundle
registerWasmApp, execWasmApp, registerWasmAppFromManifest, registerWasmService

Execution, shell and Node

Export
Kind
Guide
Shell
class
tokenize(line)
function → string[]
NodeRuntime
class
ScriptError
class

Serve and service worker

Export
Kind
Guide
ServeBridge
class (register, previewUrl, detach, unregister)
startServer(nano, launch, opts)
function → { stop }
parseHttpResponse(bytes)
function
registerNanoServiceWorker(opts), ensureCrossOriginIsolated(opts)
functions

Worker, headless, provisioning

Export
Kind
Guide
createNanoWorker(config, factory?, opts?), NanoWorkerClient
function, class
createHeadless(config)
function → HeadlessSession
provision(catalog, ref, opts)
function → ProvisionedApp

Catalog

Export
Kind
Guide
Catalog
class (index, manifest, install, installBundle, bundleManifest, categories, collections)
CdnClient, openChunkCache, defaultGenerationStore
class, function, object
installApp, resolveIndex, resolveManifest, fetchVerifiedChunk
low-level functions
verifySigned, sha256Hex, canonicalize, catalogPublicKey, publicKeyFromB64, CATALOG_PUBLIC_KEY_B64
crypto helpers
manifestKind, isWasmKind, kindToTier, manifestTier
functions

Agent subpath

Export
Kind
Guide
createVmTools(host, opts)
function → AgentTool[]
exposeWebMcp(tools, opts), isWebMcpAvailable()
functions
truncateOutput(text, max)
function
AgentTool, AgentHost, AgentToolsOptions, AgentToolResult, AgentApprove, WebMcpOptions
types

Terminal subpath

Export
Kind
Guide
defineNanoTerminal(tag?)
function
createTerminal(target, config)
function → TerminalHandle
NanoTerminalElement
class

Live, end-to-end uses of these exports: the examples gallery and the feature pages.

Types

NanoConfig, ImageConfig, BinarySource, EngineConfig, ScriptingConfig, ExecOptions, ExecResult, DirEntry, ShellOptions, ShellResult, ShellHost, ExposeConfig, RuntimeLimits, ScriptEngineOptions, ScriptEngine, ConnectionInjector, ServeBridgeOptions, ParsedHttpResponse, StartServerOptions, ServerLaunch, NodeRunOptions, VMSnapshot, NanoImageOptions, NanoWorkerOptions, HeadlessConfig, HeadlessSession, ProvisionOptions, ProvisionedApp, CatalogOptions, CdnOptions, ChunkCache, GenerationStore, Manifest, SignedIndex, AppRecipe, Collection, InstallOptions, InstallProgress, ArtifactKind, Tier and the terminal's TerminalConfig are exported and documented on the guides above.