TypeScript SDK
Check, run, and prove from your app.
One package installs the client and the engine payload. Local by default. Point it at nika serve when you have a URL and a token.
- Prerequisite: Node.js 22 or newer.
- Install the pinned package:
npm install @supernovae-st/[email protected] - Save
hello.nikaanddemo.mjs, then runnode demo.mjs. - Expected rehearsal result:
{ greeting: 'mock(echo) · Hello from my app.' }
hello.nika
nika: hellomodel: mock/echopermits: {}tasks: greeting: infer: prompt: "Hello from my app." max_tokens: 32outputs: greeting: ${{ tasks.greeting.output }}demo.mjsjavascript
import { Nika, isNikaRunSucceeded } from '@supernovae-st/nika' const nika = new Nika()const run = await nika.run('hello.nika', { maxCostUsd: 0 })const result = await run.result()if (!isNikaRunSucceeded(result)) throw new Error(result.status)console.log(result.outputs) Then check, watch events, verify the journal
next.mjsjavascript
import { Nika, isNikaRunSucceeded } from '@supernovae-st/nika' const nika = new Nika()const report = await nika.check('hello.nika', { nativeStrict: true })if (!report.clean) throw new Error('check refused the file') const run = await nika.run('hello.nika', { maxCostUsd: 0 })for await (const event of run.events()) console.log(event.kind)const result = await run.result()if (!isNikaRunSucceeded(result)) throw new Error(result.status)if (result.receipt) { const proof = await nika.traceVerify(result.receipt) console.log(proof.verdict)} npm
@supernovae-st/[email protected] (bundles engine 0.120.3)
CLI binary
nika 0.120.3 (GitHub release, standalone)
mock/echo
rehearsal, no network, not a real model answer
traceVerify
checks an existing journal; it does not seal one or rerun the model
mock/echo is a rehearsal. It does not call a paid model. traceVerify checks an existing journal. It does not add a seal and it does not call the model again.
Canonical URL https://nika.sh/sdk. Language reference lives on docs.nika.sh, not here.