Installation & configuration
@apulodi/sdk is the official TypeScript client for the APULODI file
platform. It is dependency-free and fully typed — each capability is a
simple, promise-based method with autocompletion for every request and
response. (See the endpoint reference table at the bottom for how each
method maps to the underlying API.)
Install
npm install @apulodi/sdk
pnpm add @apulodi/sdk
yarn add @apulodi/sdk
Requires Node.js 18.17+ (uses the global fetch).
Configure
import { Apulodi } from "@apulodi/sdk";
const apulodi = new Apulodi({
apiKey: process.env.APULODI_API_KEY!,
});
For a local development server:
const apulodi = new Apulodi({
apiKey: process.env.APULODI_API_KEY!,
baseUrl: "http://localhost:3000",
});
The client rejects an empty apiKey and non-http(s) baseUrl at
construction, so misconfiguration fails fast.
Client options
| Option | Type | Default | Description |
|---|---|---|---|
apiKey | string | — (required) | Project-scoped API key (apk_test_… / apk_live_…) |
baseUrl | string | https://api.apulodi.com | API origin |
timeoutMs | number | 30000 | Per-request timeout in milliseconds |
fetch | typeof fetch | global | Custom fetch (tests, proxies) |
Verify your key
const ctx = await apulodi.me();
console.log(ctx.project.name, ctx.apiKey.environment);
me() calls GET /v1/me and returns the resolved project / organization /
API key context.
Server-side only
Your API key is a secret. The SDK is built for Node.js backends, edge functions and build-time tooling — never for browser code. Bundling the SDK (and your key) into client JavaScript would hand your key to every visitor.
Browser uploads should ask your backend for a temporary presigned URL, which
is exactly what apulodi.files.upload() produces server-side.
Endpoint reference
| SDK | REST API |
|---|---|
apulodi.me() | GET /v1/me |
apulodi.files.list() / iterate() | GET /v1/files |
apulodi.files.get() | GET /v1/files/:id |
apulodi.files.upload() | POST /v1/files/upload + PUT + POST /v1/files/:id/complete |
apulodi.files.update() | PATCH /v1/files/:id |
apulodi.files.delete() | DELETE /v1/files/:id |
apulodi.files.copy() | POST /v1/files/:id/copy |
apulodi.files.downloadUrl() | POST /v1/files/:id/download-url |
apulodi.files.restore() | POST /v1/files/:id/restore |
apulodi.files.replace() | POST /v1/files/:id/replace + PUT + POST /v1/files/:id/replace/complete |
apulodi.files.transform() | POST /v1/files/:id/transform |
apulodi.files.variants() | GET /v1/files/:id/variants |
apulodi.files.waitForVariant() | GET /v1/files/:id/variants (polling) |
apulodi.files.variantDownloadUrl() | POST /v1/files/:id/variants/:variantId/download-url |
apulodi.uploads.* | /v1/uploads/multipart* |
apulodi.folders.list() | GET /v1/folders |
Next: SDK — Files.