@clomanai/sdk
v0.1.1
Published
Official TypeScript/JavaScript SDK for the CloMan API
Maintainers
Readme
@clomanai/sdk
Official TypeScript/JavaScript client for the CloMan API — query your AI clones programmatically.
Installation
npm install @clomanai/sdkQuick Start
import { CloMan } from "@clomanai/sdk";
const client = new CloMan("cloman_...");
const result = await client.decide({
context: "Should we approve this refund request?",
});
console.log(result.decision); // "approve" / "deny" / ...
console.log(result.confidence); // 0.92
console.log(result.reasoning); // "Based on the refund policy..."Configuration
const client = new CloMan("cloman_...", {
baseUrl: "https://api.cloman.app", // default; override for self-hosted
timeout: 30000, // request timeout in ms
maxRetries: 3, // retries on 5xx errors
});Error Handling
import { CloMan, AuthenticationError, RateLimitError } from "@clomanai/sdk";
const client = new CloMan("cloman_...");
try {
const result = await client.decide({ context: "..." });
} catch (error) {
if (error instanceof AuthenticationError) {
console.log("Invalid API key");
} else if (error instanceof RateLimitError) {
console.log(`Rate limited, retry after: ${error.retryAfter}s`);
}
}Requirements
- Node.js 18+ (uses native
fetch) - Zero runtime dependencies
Documentation
Full documentation: docs.viwoapp.io
License
MIT
