Skip to content

API entry points ​

The package exposes intentional layer-specific entry points. Import from the narrowest entry point that owns the capability you need.

Entry pointRuntimeMain exports
@codex-app-sdk/coreAny TypeScript runtimeRenderer-safe surface, event, attachment, and host-capability contracts
@codex-app-sdk/core/surfaceAny TypeScript runtimeSurface snapshots, actions, messages, and renderer-safe attachment options
@codex-app-sdk/core/nativeRenderer-safe hostsFile/clipboard/link/transcription capability contracts
@codex-app-sdk/core/eventsAny TypeScript runtimeTyped event bus primitives
@codex-app-sdk/core/surface-bridgeHost adaptersValidated surface operation dispatch shared by Electron and web
@codex-app-sdk/backendTrusted Node hostCodexSurface, CodexAppBackend, transports, discovery, extensions, MCP, history adapters
@codex-app-sdk/backend/protocolTrusted Node hostLow-level app-server client and generated protocol types
@codex-app-sdk/electronElectron main + renderer typesComplete bridge, native capabilities, typed IPC composition
@codex-app-sdk/electron/preloadElectron preloadexposeCodexElectronPreload and preload-safe types
@codex-app-sdk/web/clientBrowserWebSocket-backed CodexSurfaceRendererApi and reconnect policy
@codex-app-sdk/web/serverNode or compatible server runtimeEstablished-socket binding, authorization callback, and surface lease
@codex-app-sdk/vueVue rendererController, pane, composer, host-defined mentions, messages, tools, media, theme, utilities
@codex-app-sdk/vue/styles.cssRenderer CSSComplete scoped component theme
codex-app-sdk/*CompatibilityPrevious aggregate entry points retained during migration

Typical imports ​

ts
// Electron main
import { createCodexAppBackend } from '@codex-app-sdk/backend';
import { registerCodexElectronMain } from '@codex-app-sdk/electron';

// Preload
import { exposeCodexElectronPreload } from '@codex-app-sdk/electron/preload';

// Vue renderer
import {
  CodexConversationPane,
  useCodexSurface,
} from '@codex-app-sdk/vue';
import '@codex-app-sdk/vue/styles.css';
ts
// Web server: use inside your existing upgrade/authentication flow
import {
  bindCodexWebSocket,
  createCodexNodeWebSocketPort,
} from '@codex-app-sdk/web/server';

// Browser
import {
  createCodexBrowserWebSocketPort,
  createCodexWebSurfaceClient,
} from '@codex-app-sdk/web/client';

The scaffold wires these imports together. Use the entry point table when adding a capability to that generated baseline.

Stability boundary ​

The surface, Electron, web, Vue, and semantic event contracts are product-shaped. The @codex-app-sdk/backend/protocol entry point follows the generated app-server schema more directly and may change when bindings are regenerated.

Use raw generated types in trusted integration code only. Do not make ordinary renderer components depend on them.

The JSON-RPC coverage inventory tracks which generated app-server methods are projected by the high-level SDK and which remain low-level only.

For the major composed contracts, start with conversation pane integration, history and performance, or remote control before dropping to individual types.

Released under the Apache License 2.0.