Installation
Initialize
Ask an executive
Request a governed decision
Error handling
Wrap calls and inspect the typed error for the machine-readablecode:
API Reference
Full endpoint reference, generated from OpenAPI.
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Official TypeScript / JavaScript client for the Operark API.
npm install @operark/sdk
# or: pnpm add @operark/sdk / yarn add @operark/sdk
import { Operark } from '@operark/sdk';
const client = new Operark({
apiKey: process.env.OPERARK_API_KEY,
});
const response = await client.executives.CEO.ask({
question: "What's our strategy for Q2?",
});
console.log(response.answer);
const decision = await client.executives.CRO.decide({
question: "Approve a new vendor without ISO 27001?",
});
console.log(decision.outcome, decision.rationale);
code:
import { Operark, OperarkError } from '@operark/sdk';
try {
await client.executives.CFO.ask({ question: "Q2 burn rate?" });
} catch (err) {
if (err instanceof OperarkError) {
console.error(err.code, err.message);
}
}