App Developer Guide
Use this path if you are building a third-party app that consumes Nimi runtime, realm, or both.
Integration model
Runtimefor local AI execution (gRPC)Realmfor cloud state (REST + WebSocket)@nimiplatform/sdkas the only supported developer entry pointnimi-app createfrom@nimiplatform/dev-toolsas the author-side scaffold entry point
Recommended flow
- Start with SDK Setup.
- Scaffold a repo with
pnpm dlx @nimiplatform/dev-tools nimi-app create --dir my-nimi-app --template basic. - Use
examples/app-templateas the tracked minimal app shape. - Use
examples/sdk/01-hello.tsas the smallest baseline. - Move to
examples/sdk/03-local-vs-cloud.tsonce you want both execution planes. - Adopt structured error handling using
reasonCodeandtraceId.
Scaffold once
bash
pnpm dlx @nimiplatform/dev-tools nimi-app create --dir my-nimi-app --template basic
cd my-nimi-app
pnpm install
pnpm startAvailable templates today:
basicvercel-ai
If you are reading this inside the monorepo before public package publication, note that tracked templates use published semver package names. They are the reference output shape, not necessarily self-installing workspace packages yet.
Recommended integration shape
Use the runtime as the operational boundary and keep provider keys in the runtime process, not spread through every app.
ts
import { Runtime } from '@nimiplatform/sdk/runtime';
const runtime = new Runtime();
const result = await runtime.generate({
prompt: 'What is Nimi?',
});
console.log(result.text);Add provider: 'gemini' when you want the provider default cloud model:
ts
const result = await runtime.generate({
provider: 'gemini',
prompt: 'What is Nimi?',
});If you want a tracked example for the basic scaffold shape, see examples/app-template. If you want a provider-bridged example, see examples/sdk/04-vercel-ai-sdk.ts.
Production checklist
- Explicit timeout and fallback policy on AI calls when moving beyond first-run defaults
- Runtime/realm token lifecycle handling
- Error telemetry with
traceId - Version compatibility check before release
See Compatibility Matrix.