@oleq-ai/file-manager
v0.1.14
Published
Oleq AI file manager JavaScript/TypeScript SDK for apps and file uploads
Maintainers
Readme
@oleq-ai/file-manager
JavaScript/TypeScript SDK for OleqFiles — manage apps and upload files via presigned S3 URLs.
Works in Node 18+, Bun, NestJS, and Next.js server code. Ships ESM, CJS, and TypeScript declarations.
Install
pnpm add @oleq-ai/file-managernpm install @oleq-ai/file-managerbun add @oleq-ai/file-managerQuick start
export OLEQFILES_API_KEY=sk_test_… # or sk_live_… for production appsimport OleqFiles, { OleqFilesError } from '@oleq-ai/file-manager';
const oleqfiles = new OleqFiles();
const { apps } = await oleqfiles.apps.list();
const app = await oleqfiles.apps.create({ name: 'My app' });
const { id, src } = await oleqfiles.files.upload({
appId: app.id,
name: 'photo.jpg',
mimeType: 'image/jpeg',
data: fileBuffer,
});Everything the SDK does is also available in the portal.
Configuration
new OleqFiles() is enough when OLEQFILES_API_KEY is set.
| Option | Required | Description |
| ---------------- | -------- | ---------------------------------------------------- |
| apiKey | no* | sk_test_… or sk_live_… |
| baseUrl | no | API origin; defaults to https://uploadspi.oleq.app |
| organizationId | no | Sent as x-organization-id when set |
| fetch | no | Custom fetch for tests or agents |
*Required unless OLEQFILES_API_KEY is set.
Surface
oleqfiles.apps— list, get, create, update, delete, promoteoleqfiles.files— upload, list, get, get URL, deleteoleqfiles.usage— org usage, limits, storage visibility@oleq-ai/file-manager/react—useOleqFilesUpload()withprogress(0–100) and optionalonProgresscallback@oleq-ai/file-manager/nest—OleqFilesModule.forRoot()NestJS DI adapterOleqFilesError— thrown on API / upload failures
Examples (HTML, Next.js, NestJS): docs.oleq.app
REST details: HTTP API.
Docs
Full guide: docs.oleq.app
License
MIT
