imagekit-sdk-reference

Installation
SKILL.md

ImageKit TypeScript SDK Reference

Read this skill before calling any mcp_imagekit_api_* tool or writing TypeScript code against the ImageKit SDK. It contains exact method signatures, parameter types, return shapes, and error handling patterns for @imagekit/nodejs.

Rules:

  1. Use exact parameter names — the SDK is strict about camelCase
  2. assets.list() returns (File | Folder)[]. Narrow with for...of + if (item.type === 'file'), never .filter((i): i is File => ...). See the search-assets skill for the full rules on searchQuery vs a typed File[] and why the predicate fails.
  3. In execute/MCP code, do NOT try/catch single API calls — the tool reports errors for you. Only catch when you branch on a specific failure, and duck-type the error ('status' in err) rather than instanceof ImageKit.APIError, since a value import of the SDK is not available in the sandbox.
  4. Use skip/limit for pagination (max 1000 per request)
  5. Uploads are URL-only — the file param must be a URL string; local file paths, Buffers, and streams cannot be passed. Read the upload-files skill first.
  6. Nullable properties (tags, AITags, customCoordinates) require optional chaining (?.) or null checks
  7. .find() returns T | undefined — always check for undefined before accessing properties

TypeScript Gotchas

Union narrowing for assets.list() results — for...of + if, why the .filter((i): i is File => ...) predicate collides with Deno's global File, and searchQuery vs a typed File[] — is covered in full by the search-assets skill; follow it when handling list results. The gotchas below are the SDK-specific ones not covered there.

Installs
29
GitHub Stars
2
First Seen
Jul 1, 2026
imagekit-sdk-reference — imagekit-developer/skills