Oleq Files

Installation

Install and initialize @oleq-ai/file-manager

Package: @oleq-ai/file-manager

Works in JavaScript and TypeScript (Node 18+, NestJS, Next.js server code). Ships ESM + CJS and .d.ts typings.

Portal

Everything the SDK does — create apps, upload files, manage keys — can also be done in the portal. Use the SDK when you want to automate from your backend.

Package name

npm scoped packages require @scope/name@oleqfiles alone is not valid. The SDK is published as @oleq-ai/file-manager with subpath exports for React and Nest.

1. Install the package

pnpm add @oleq-ai/file-manager

Optional entry points (same install):

  • @oleq-ai/file-manager/react — browser upload hook (peer: react)
  • @oleq-ai/file-manager/nest — NestJS module (peer: @nestjs/common)

2. Create an API key

  1. Sign in to the portal.
  2. Open API keys and create a key (sk_test_… for sandbox apps, sk_live_… for production apps).
  3. Copy the secret once — it is only shown at creation.

3. Set the environment variable

export OLEQFILES_API_KEY=sk_test_…

In Next.js / NestJS, put the same value in .env (server-side only):

OLEQFILES_API_KEY=sk_live_…

Sandbox and production share the same API host. The key prefix selects which apps you can use.

4. Initialize the client

import OleqFiles from '@oleq-ai/file-manager';

const oleqfiles = new OleqFiles();

That is enough. The SDK reads OLEQFILES_API_KEY. The default API host is https://uploadspi.oleq.app.

You only pass options when you need to override something:

const oleqfiles = new OleqFiles({
  apiKey: 'sk_test_…', // optional if env is set
  baseUrl: 'http://localhost:3000', // local / custom API
});

Requirements

  • Node.js 18+ (or a runtime with global fetch and crypto.subtle)
  • OLEQFILES_API_KEY in the environment (or apiKey in options) starting with sk_test_… or sk_live_…

Next: Usage

On this page