Prerequisites
- Node.js 18 or later (the SDK uses native
fetchandBuffer) - A FlexOrch API key (format:
dfx_<random_string>) — find yours in the FlexOrch dashboard
Installation
import { FlexOrch } from "@flexorch/sdk";
const client = new FlexOrch({
apiKey: process.env.FLEXORCH_API_KEY,
});
If
FLEXORCH_API_KEY is set in your environment, the SDK picks it up
automatically — you can omit apiKey from the constructor.Pass a local file path to
client.documents.upload(). The method returns a Promise<Job> that resolves as soon as the document is queued.const job = await client.documents.upload("invoice.pdf");
console.log(`Job created: ${job.id} | Status: ${job.status}`);
Call
job.waitUntilDone() to await the job’s terminal state (completed or failed). The SDK handles polling and exponential back-off automatically.Full working example
Processing time depends on file size and plan tier. Most documents under 10 MB
complete within 30 seconds on the Growth plan.
Next steps
Upload Documents
Learn single-file, batch, and connector-based upload patterns.
Manage Jobs
Poll job status, filter by quality grade, and submit feedback.
Build Datasets
Combine completed jobs into exportable, LLM-ready datasets.
API Reference
Full class and method reference for the TypeScript SDK.