JavaScript/TypeScript SDK

@apulodi/sdk is the official TypeScript/JavaScript SDK: a thin, fully typed HTTP layer over the REST API with zero runtime dependencies. (See the endpoint reference table at the bottom for how each method maps to the underlying API.)

Prefer Python? The apulodi package has its own guide — Python SDK — covering install, configuration and every resource with idiomatic examples.

Install

npm install @apulodi/sdk

Requires Node.js 18.17+ (uses the global fetch). Zero dependencies.

Configure

ts
import { Apulodi } from "@apulodi/sdk";

const apulodi = new Apulodi({
  apiKey: process.env.APULODI_API_KEY!,
});

For a local development server:

ts
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

OptionTypeDefaultDescription
apiKeystring— (required)Project-scoped API key (apk_test_… / apk_live_…)
baseUrlstringhttps://app.apulodi.devAPI origin
timeoutMsnumber30000Per-request timeout in milliseconds
fetchtypeof fetchglobalCustom fetch (tests, proxies)

Verify your key

ts
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 server runtimes — Node.js backends, edge functions, 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

SDKREST 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 — Python.