Skip to main content
npm install flexorch-sdk
Requires Node.js 18+. Works with ESM and CommonJS.

Setup

Set your API key as an environment variable:
export FLEXORCH_API_KEY=dfx_your_key_here
The client picks it up automatically:
import { FlexOrchClient } from 'flexorch-sdk';

const client = new FlexOrchClient(); // reads FLEXORCH_API_KEY from env
Or pass it explicitly:
const client = new FlexOrchClient('dfx_your_key_here');

// options object form
const client = new FlexOrchClient({
  apiKey: 'dfx_your_key_here',
  timeout: 60,     // seconds — default 30
  maxRetries: 3,   // default 3
});

CommonJS

const { FlexOrchClient } = require('flexorch-sdk');

const client = new FlexOrchClient();

TypeScript types

All exports are fully typed. Import types alongside the client:
import { FlexOrchClient } from 'flexorch-sdk';
import type { ExportFormat } from 'flexorch-sdk';

const format: ExportFormat = 'jsonl'; // "json" | "jsonl" | "csv" | "parquet" | "md" | "xml" | "xlsx" | "rag"

Verify

import { FlexOrchClient } from 'flexorch-sdk';

const client = new FlexOrchClient();
const usage = await client.usage.get();
console.log(usage.plan);                      // "trial"
console.log(usage.creditsUsed);               // 0
console.log(usage.creditsRemaining);          // 1200