{"id":47669288,"url":"https://github.com/imagekit-developer/imagekit-nodejs","last_synced_at":"2026-04-06T09:03:11.969Z","repository":{"id":37671055,"uuid":"204726998","full_name":"imagekit-developer/imagekit-nodejs","owner":"imagekit-developer","description":"Node.js SDK for ImageKit.io API.","archived":false,"fork":false,"pushed_at":"2026-03-31T16:21:41.000Z","size":2920,"stargazers_count":130,"open_issues_count":8,"forks_count":47,"subscribers_count":6,"default_branch":"master","last_synced_at":"2026-03-31T18:29:50.072Z","etag":null,"topics":["image-manipulation","imagekit","sdk"],"latest_commit_sha":null,"homepage":"https://imagekit.io","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/imagekit-developer.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2019-08-27T14:57:05.000Z","updated_at":"2026-03-30T06:08:32.000Z","dependencies_parsed_at":"2026-01-05T19:08:36.467Z","dependency_job_id":null,"html_url":"https://github.com/imagekit-developer/imagekit-nodejs","commit_stats":{"total_commits":182,"total_committers":18,"mean_commits":10.11111111111111,"dds":0.5494505494505495,"last_synced_commit":"3f2e121a3b46d0609b4bd234d7bf0947d272a794"},"previous_names":[],"tags_count":38,"template":false,"template_full_name":null,"purl":"pkg:github/imagekit-developer/imagekit-nodejs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imagekit-developer%2Fimagekit-nodejs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imagekit-developer%2Fimagekit-nodejs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imagekit-developer%2Fimagekit-nodejs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imagekit-developer%2Fimagekit-nodejs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/imagekit-developer","download_url":"https://codeload.github.com/imagekit-developer/imagekit-nodejs/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imagekit-developer%2Fimagekit-nodejs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31306024,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-02T09:48:21.550Z","status":"ssl_error","status_checked_at":"2026-04-02T09:48:19.196Z","response_time":89,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["image-manipulation","imagekit","sdk"],"created_at":"2026-04-02T12:24:38.708Z","updated_at":"2026-04-02T12:24:39.250Z","avatar_url":"https://github.com/imagekit-developer.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ImageKit.io Node.js SDK\n\n[![NPM version](\u003chttps://img.shields.io/npm/v/@imagekit/nodejs.svg?label=npm%20(stable)\u003e)](https://npmjs.org/package/@imagekit/nodejs) ![npm bundle size](https://img.shields.io/bundlephobia/minzip/@imagekit/nodejs)\n\nThe ImageKit Node.js SDK is a comprehensive library designed to simplify the integration of ImageKit into your server-side applications. It provides powerful tools for working with the ImageKit REST API, including building and transforming URLs, generating signed URLs for secure content delivery, verifying webhooks, and handling file uploads. With robust TypeScript support, this SDK ensures excellent type safety and a seamless developer experience.\n\nThe full API of this library is documented in [api.md](api.md). All request parameters and response types are fully typed and importable, offering unparalleled TypeScript support. This ensures that you can rely on accurate type definitions and enjoy a smooth development workflow with modern editors.\n\nFor additional details, refer to the [ImageKit REST API documentation](https://imagekit.io/docs/api-reference).\n\nIf you are looking to integrate file uploads in browsers, use one of our [frontend SDKs](https://imagekit.io/docs/quick-start-guides#front-end).\n\n## Table of Contents\n\n- [Installation](#installation)\n- [MCP Server Package](#mcp-server-package)\n- [Usage](#usage)\n  - [Request \u0026 Response types](#request--response-types)\n- [File uploads](#file-uploads)\n- [URL generation](#url-generation)\n  - [Basic URL generation](#basic-url-generation)\n  - [URL generation with transformations](#url-generation-with-transformations)\n  - [URL generation with image overlay](#url-generation-with-image-overlay)\n  - [URL generation with text overlay](#url-generation-with-text-overlay)\n  - [URL generation with multiple overlays](#url-generation-with-multiple-overlays)\n  - [Signed URLs for secure delivery](#signed-urls-for-secure-delivery)\n  - [Using Raw parameter for custom transformations](#using-raw-parameter-for-custom-transformations)\n- [Authentication parameters for client-side uploads](#authentication-parameters-for-client-side-uploads)\n- [Webhook verification](#webhook-verification)\n  - [Verifying webhook signatures](#verifying-webhook-signatures)\n- [Handling errors](#handling-errors)\n  - [Retries](#retries)\n  - [Timeouts](#timeouts)\n- [Advanced Usage](#advanced-usage)\n  - [Accessing raw Response data (e.g., headers)](#accessing-raw-response-data-eg-headers)\n  - [Logging](#logging)\n  - [Making custom/undocumented requests](#making-customundocumented-requests)\n  - [Customizing the fetch client](#customizing-the-fetch-client)\n  - [Fetch options](#fetch-options)\n- [Semantic versioning](#semantic-versioning)\n- [Requirements](#requirements)\n- [Contributing](#contributing)\n\n## Installation\n\n```sh\nnpm install @imagekit/nodejs\n```\n\n## MCP Server Package\n\nThis repository also includes a separate **Model Context Protocol (MCP) server** package published as [`@imagekit/api-mcp`](https://www.npmjs.com/package/@imagekit/api-mcp). This MCP server enables AI assistants and agents to interact with the ImageKit API directly.\n\n\u003e **Important Note on Versioning:** The MCP server package (`@imagekit/api-mcp`) is maintained within this monorepo and shares the same version number as the main Node.js SDK. **However, semantic versioning for this repository is determined solely based on changes to the Node.js SDK (`@imagekit/nodejs`).** This means the MCP server package may contain breaking changes in minor or patch releases, as its versioning does not follow independent semantic versioning conventions. If you use the MCP server package, always review the [CHANGELOG](CHANGELOG.md) to understand what has changed before upgrading.\n\nFor detailed installation instructions, usage examples, and documentation about the MCP server, please visit:\n- **MCP Server Documentation:** [https://imagekit.io/docs/mcp-server](https://imagekit.io/docs/mcp-server)\n- **Package README:** [packages/mcp-server/README.md](packages/mcp-server/README.md)\n\n## Usage\n\nThe full API of this library can be found in [api.md](api.md).\n\n\u003c!-- prettier-ignore --\u003e\n```js\nimport ImageKit from '@imagekit/nodejs';\n\nconst client = new ImageKit({\n  privateKey: process.env['IMAGEKIT_PRIVATE_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.files.upload({\n  file: fs.createReadStream('path/to/file'),\n  fileName: 'file-name.jpg',\n});\n\nconsole.log(response);\n```\n\n### Request \u0026 Response types\n\nThis library includes TypeScript definitions for all request params and response fields. You may import and use them like so:\n\n\u003c!-- prettier-ignore --\u003e\n```ts\nimport ImageKit from '@imagekit/nodejs';\n\nconst client = new ImageKit({\n  privateKey: process.env['IMAGEKIT_PRIVATE_KEY'], // This is the default and can be omitted\n});\n\nconst params: ImageKit.FileUploadParams = {\n  file: fs.createReadStream('path/to/file'),\n  fileName: 'file-name.jpg',\n};\nconst response: ImageKit.FileUploadResponse = await client.files.upload(params);\n```\n\nDocumentation for each method, request param, and response field are available in docstrings and will appear on hover in most modern editors.\n\n## File uploads\n\nRequest parameters that correspond to file uploads can be passed in many different forms:\n\n- `File` (or an object with the same structure)\n- a `fetch` `Response` (or an object with the same structure)\n- an `fs.ReadStream`\n- the return value of our `toFile` helper\n\n```ts\nimport fs from 'fs';\nimport ImageKit, { toFile } from '@imagekit/nodejs';\n\nconst client = new ImageKit();\n\n// If you have access to Node `fs` we recommend using `fs.createReadStream()`:\nawait client.files.upload({ file: fs.createReadStream('/path/to/file'), fileName: 'fileName' });\n\n// Or if you have the web `File` API you can pass a `File` instance:\nawait client.files.upload({ file: new File(['my bytes'], 'file'), fileName: 'fileName' });\n\n// You can also pass a `fetch` `Response`:\nawait client.files.upload({ file: await fetch('https://somesite/file'), fileName: 'fileName' });\n\n// Finally, if none of the above are convenient, you can use our `toFile` helper:\nawait client.files.upload({\n  file: await toFile(Buffer.from('my bytes'), 'file'),\n  fileName: 'fileName',\n});\nawait client.files.upload({\n  file: await toFile(new Uint8Array([0, 1, 2]), 'file'),\n  fileName: 'fileName',\n});\n```\n\n## URL generation\n\nThe ImageKit SDK provides a powerful `helper.buildSrc()` method for generating optimized image and video URLs with transformations. Here are examples ranging from simple URLs to complex transformations with overlays and signed URLs.\n\n### Basic URL generation\n\nGenerate a simple URL without any transformations:\n\n```ts\nimport ImageKit from '@imagekit/nodejs';\n\nconst client = new ImageKit({\n  privateKey: process.env['IMAGEKIT_PRIVATE_KEY'],\n});\n\n// Basic URL without transformations\nconst url = client.helper.buildSrc({\n  urlEndpoint: 'https://ik.imagekit.io/your_imagekit_id',\n  src: '/path/to/image.jpg',\n});\n// Result: https://ik.imagekit.io/your_imagekit_id/path/to/image.jpg\n```\n\n### URL generation with transformations\n\nApply common transformations like resizing, cropping, and format conversion:\n\n```ts\n// URL with basic transformations\nconst transformedUrl = client.helper.buildSrc({\n  urlEndpoint: 'https://ik.imagekit.io/your_imagekit_id',\n  src: '/path/to/image.jpg',\n  transformation: [\n    {\n      width: 400,\n      height: 300,\n      crop: 'maintain_ratio',\n      quality: 80,\n      format: 'webp',\n    },\n  ],\n});\n// Result: https://ik.imagekit.io/your_imagekit_id/path/to/image.jpg?tr=w-400,h-300,c-maintain_ratio,q-80,f-webp\n```\n\n### URL generation with image overlay\n\nAdd image overlays to your base image:\n\n```ts\n// URL with image overlay\nconst imageOverlayUrl = client.helper.buildSrc({\n  urlEndpoint: 'https://ik.imagekit.io/your_imagekit_id',\n  src: '/path/to/base-image.jpg',\n  transformation: [\n    {\n      width: 500,\n      height: 400,\n      overlay: {\n        type: 'image',\n        input: '/path/to/overlay-logo.png',\n        position: {\n          x: 10,\n          y: 10,\n        },\n        transformation: [\n          {\n            width: 100,\n            height: 50,\n          },\n        ],\n      },\n    },\n  ],\n});\n// Result: URL with image overlay positioned at x:10, y:10\n```\n\n### URL generation with text overlay\n\nAdd customized text overlays:\n\n```ts\n// URL with text overlay\nconst textOverlayUrl = client.helper.buildSrc({\n  urlEndpoint: 'https://ik.imagekit.io/your_imagekit_id',\n  src: '/path/to/base-image.jpg',\n  transformation: [\n    {\n      width: 600,\n      height: 400,\n      overlay: {\n        type: 'text',\n        text: 'Sample Text Overlay',\n        position: {\n          x: 50,\n          y: 50,\n          focus: 'center',\n        },\n        transformation: [\n          {\n            fontSize: 40,\n            fontFamily: 'Arial',\n            fontColor: 'FFFFFF',\n            typography: 'b', // bold\n          },\n        ],\n      },\n    },\n  ],\n});\n// Result: URL with bold white Arial text overlay at center position\n```\n\n### URL generation with multiple overlays\n\nCombine multiple overlays for complex compositions:\n\n```ts\n// URL with multiple overlays (text + image)\nconst multipleOverlaysUrl = client.helper.buildSrc({\n  urlEndpoint: 'https://ik.imagekit.io/your_imagekit_id',\n  src: '/path/to/base-image.jpg',\n  transformation: [\n    {\n      width: 800,\n      height: 600,\n      overlay: {\n        type: 'text',\n        text: 'Header Text',\n        position: { x: 20, y: 20 },\n        transformation: [{ fontSize: 30, fontColor: '000000' }],\n      },\n    },\n    {\n      overlay: {\n        type: 'image',\n        input: '/watermark.png',\n        position: { focus: 'bottom_right' },\n        transformation: [{ width: 100, opacity: 70 }],\n      },\n    },\n  ],\n});\n// Result: URL with text overlay at top-left and semi-transparent watermark at bottom-right\n```\n\n### Signed URLs for secure delivery\n\nGenerate signed URLs that expire after a specified time for secure content delivery:\n\n```ts\n// Generate a signed URL that expires in 1 hour (3600 seconds)\nconst signedUrl = client.helper.buildSrc({\n  urlEndpoint: 'https://ik.imagekit.io/your_imagekit_id',\n  src: '/private/secure-image.jpg',\n  transformation: [\n    {\n      width: 400,\n      height: 300,\n      quality: 90,\n    },\n  ],\n  signed: true,\n  expiresIn: 3600, // URL expires in 1 hour\n});\n// Result: URL with signature parameters (?ik-t=timestamp\u0026ik-s=signature)\n\n// Generate a signed URL that doesn't expire\nconst permanentSignedUrl = client.helper.buildSrc({\n  urlEndpoint: 'https://ik.imagekit.io/your_imagekit_id',\n  src: '/private/secure-image.jpg',\n  signed: true,\n  // No expiresIn means the URL won't expire\n});\n// Result: URL with signature parameter (?ik-s=signature)\n```\n\n### Using Raw parameter for custom transformations\n\nImageKit frequently adds new transformation parameters that might not yet be documented in the SDK. You can use the `raw` parameter to access these features or create custom transformation strings:\n\n```ts\n// Using raw parameter for custom transformations\nconst customTransformUrl = client.helper.buildSrc({\n  urlEndpoint: 'https://ik.imagekit.io/your_imagekit_id',\n  src: '/path/to/image.jpg',\n  transformation: [\n    {\n      width: 400,\n      height: 300,\n      raw: 'something-new',\n    },\n  ],\n});\n// Result: https://ik.imagekit.io/your_imagekit_id/path/to/image.jpg?tr=w-400,h-300,something-new\n```\n\n## Authentication parameters for client-side uploads\n\nGenerate authentication parameters for secure client-side file uploads:\n\n```ts\n// Generate authentication parameters for client-side uploads\nconst authParams = client.helper.getAuthenticationParameters();\nconsole.log(authParams);\n// Result: { token: 'uuid-token', expire: timestamp, signature: 'hmac-signature' }\n\n// Generate with custom token and expiry\nconst customAuthParams = client.helper.getAuthenticationParameters('my-custom-token', 1800);\nconsole.log(customAuthParams);\n// Result: { token: 'my-custom-token', expire: 1800, signature: 'hmac-signature' }\n```\n\nThese authentication parameters can be used in client-side upload forms to securely upload files without exposing your private API key.\n\n## Webhook verification\n\nThe ImageKit SDK provides utilities to verify webhook signatures for secure event handling. This ensures that webhook requests are actually coming from ImageKit and haven't been tampered with.\n\n### Verifying webhook signatures\n\n```ts\nimport ImageKit from '@imagekit/nodejs';\n\nconst client = new ImageKit({\n  privateKey: process.env['IMAGEKIT_PRIVATE_KEY'],\n  webhookSecret: process.env['IMAGEKIT_WEBHOOK_SECRET'], // Required for webhook verification\n});\n\ntry {\n  // Verify and unwrap webhook payload\n  const event = client.webhooks.unwrap(\n    webhookBody, // Raw webhook payload (string)\n    {\n      headers: webhookHeaders, // Request headers containing signature\n    },\n  );\n\n  console.log('Webhook signature is valid');\n  console.log('Event type:', event.type);\n  console.log('Event data:', event.data);\n  // Process the webhook event\n} catch (error) {\n  console.log('Invalid webhook signature or malformed payload');\n  // Reject the request\n}\n```\n\nFor detailed information about webhook setup, signature verification, and handling different webhook events, refer to the [ImageKit webhook documentation](https://imagekit.io/docs/webhooks#verify-webhook-signature).\n\n## Handling errors\n\nWhen the library is unable to connect to the API,\nor if the API returns a non-success status code (i.e., 4xx or 5xx response),\na subclass of `APIError` will be thrown:\n\n\u003c!-- prettier-ignore --\u003e\n```ts\nconst response = await client.files\n  .upload({ file: fs.createReadStream('path/to/file'), fileName: 'file-name.jpg' })\n  .catch(async (err) =\u003e {\n    if (err instanceof ImageKit.APIError) {\n      console.log(err.status); // 400\n      console.log(err.name); // BadRequestError\n      console.log(err.headers); // {server: 'nginx', ...}\n    } else {\n      throw err;\n    }\n  });\n```\n\nError codes are as follows:\n\n| Status Code | Error Type                 |\n| ----------- | -------------------------- |\n| 400         | `BadRequestError`          |\n| 401         | `AuthenticationError`      |\n| 403         | `PermissionDeniedError`    |\n| 404         | `NotFoundError`            |\n| 422         | `UnprocessableEntityError` |\n| 429         | `RateLimitError`           |\n| \u003e=500       | `InternalServerError`      |\n| N/A         | `APIConnectionError`       |\n\n### Retries\n\nCertain errors will be automatically retried 2 times by default, with a short exponential backoff.\nConnection errors (for example, due to a network connectivity problem), 408 Request Timeout, 409 Conflict,\n429 Rate Limit, and \u003e=500 Internal errors will all be retried by default.\n\nYou can use the `maxRetries` option to configure or disable this:\n\n\u003c!-- prettier-ignore --\u003e\n```js\n// Configure the default for all requests:\nconst client = new ImageKit({\n  maxRetries: 0, // default is 2\n});\n\n// Or, configure per-request:\nawait client.files.upload({ file: fs.createReadStream('path/to/file'), fileName: 'file-name.jpg' }, {\n  maxRetries: 5,\n});\n```\n\n### Timeouts\n\nRequests time out after 1 minute by default. You can configure this with a `timeout` option:\n\n\u003c!-- prettier-ignore --\u003e\n```ts\n// Configure the default for all requests:\nconst client = new ImageKit({\n  timeout: 20 * 1000, // 20 seconds (default is 1 minute)\n});\n\n// Override per-request:\nawait client.files.upload({ file: fs.createReadStream('path/to/file'), fileName: 'file-name.jpg' }, {\n  timeout: 5 * 1000,\n});\n```\n\nOn timeout, an `APIConnectionTimeoutError` is thrown.\n\nNote that requests which time out will be [retried twice by default](#retries).\n\n## Advanced Usage\n\n### Accessing raw Response data (e.g., headers)\n\nThe \"raw\" `Response` returned by `fetch()` can be accessed through the `.asResponse()` method on the `APIPromise` type that all methods return.\nThis method returns as soon as the headers for a successful response are received and does not consume the response body, so you are free to write custom parsing or streaming logic.\n\nYou can also use the `.withResponse()` method to get the raw `Response` along with the parsed data.\nUnlike `.asResponse()` this method consumes the body, returning once it is parsed.\n\n\u003c!-- prettier-ignore --\u003e\n```ts\nconst client = new ImageKit();\n\nconst response = await client.files\n  .upload({ file: fs.createReadStream('path/to/file'), fileName: 'file-name.jpg' })\n  .asResponse();\nconsole.log(response.headers.get('X-My-Header'));\nconsole.log(response.statusText); // access the underlying Response object\n\nconst { data: response, response: raw } = await client.files\n  .upload({ file: fs.createReadStream('path/to/file'), fileName: 'file-name.jpg' })\n  .withResponse();\nconsole.log(raw.headers.get('X-My-Header'));\nconsole.log(response.videoCodec);\n```\n\n### Logging\n\n\u003e [!IMPORTANT]\n\u003e All log messages are intended for debugging only. The format and content of log messages\n\u003e may change between releases.\n\n#### Log levels\n\nThe log level can be configured in two ways:\n\n1. Via the `IMAGE_KIT_LOG` environment variable\n2. Using the `logLevel` client option (overrides the environment variable if set)\n\n```ts\nimport ImageKit from '@imagekit/nodejs';\n\nconst client = new ImageKit({\n  logLevel: 'debug', // Show all log messages\n});\n```\n\nAvailable log levels, from most to least verbose:\n\n- `'debug'` - Show debug messages, info, warnings, and errors\n- `'info'` - Show info messages, warnings, and errors\n- `'warn'` - Show warnings and errors (default)\n- `'error'` - Show only errors\n- `'off'` - Disable all logging\n\nAt the `'debug'` level, all HTTP requests and responses are logged, including headers and bodies.\nSome authentication-related headers are redacted, but sensitive data in request and response bodies\nmay still be visible.\n\n#### Custom logger\n\nBy default, this library logs to `globalThis.console`. You can also provide a custom logger.\nMost logging libraries are supported, including [pino](https://www.npmjs.com/package/pino), [winston](https://www.npmjs.com/package/winston), [bunyan](https://www.npmjs.com/package/bunyan), [consola](https://www.npmjs.com/package/consola), [signale](https://www.npmjs.com/package/signale), and [@std/log](https://jsr.io/@std/log). If your logger doesn't work, please open an issue.\n\nWhen providing a custom logger, the `logLevel` option still controls which messages are emitted, messages\nbelow the configured level will not be sent to your logger.\n\n```ts\nimport ImageKit from '@imagekit/nodejs';\nimport pino from 'pino';\n\nconst logger = pino();\n\nconst client = new ImageKit({\n  logger: logger.child({ name: 'ImageKit' }),\n  logLevel: 'debug', // Send all messages to pino, allowing it to filter\n});\n```\n\n### Making custom/undocumented requests\n\nThis library is typed for convenient access to the documented API. If you need to access undocumented\nendpoints, params, or response properties, the library can still be used.\n\n#### Undocumented endpoints\n\nTo make requests to undocumented endpoints, you can use `client.get`, `client.post`, and other HTTP verbs.\nOptions on the client, such as retries, will be respected when making these requests.\n\n```ts\nawait client.post('/some/path', {\n  body: { some_prop: 'foo' },\n  query: { some_query_arg: 'bar' },\n});\n```\n\n#### Undocumented request params\n\nTo make requests using undocumented parameters, you may use `// @ts-expect-error` on the undocumented\nparameter. This library doesn't validate at runtime that the request matches the type, so any extra values you\nsend will be sent as-is.\n\n```ts\nclient.files.upload({\n  // ...\n  // @ts-expect-error baz is not yet public\n  baz: 'undocumented option',\n});\n```\n\nFor requests with the `GET` verb, any extra params will be in the query, all other requests will send the\nextra param in the body.\n\nIf you want to explicitly send an extra argument, you can do so with the `query`, `body`, and `headers` request\noptions.\n\n#### Undocumented response properties\n\nTo access undocumented response properties, you may access the response object with `// @ts-expect-error` on\nthe response object, or cast the response object to the requisite type. Like the request params, we do not\nvalidate or strip extra properties from the response from the API.\n\n### Customizing the fetch client\n\nBy default, this library expects a global `fetch` function is defined.\n\nIf you want to use a different `fetch` function, you can either polyfill the global:\n\n```ts\nimport fetch from 'my-fetch';\n\nglobalThis.fetch = fetch;\n```\n\nOr pass it to the client:\n\n```ts\nimport ImageKit from '@imagekit/nodejs';\nimport fetch from 'my-fetch';\n\nconst client = new ImageKit({ fetch });\n```\n\n### Fetch options\n\nIf you want to set custom `fetch` options without overriding the `fetch` function, you can provide a `fetchOptions` object when instantiating the client or making a request. (Request-specific options override client options.)\n\n```ts\nimport ImageKit from '@imagekit/nodejs';\n\nconst client = new ImageKit({\n  fetchOptions: {\n    // `RequestInit` options\n  },\n});\n```\n\n#### Configuring proxies\n\nTo modify proxy behavior, you can provide custom `fetchOptions` that add runtime-specific proxy\noptions to requests:\n\n\u003cimg src=\"https://raw.githubusercontent.com/stainless-api/sdk-assets/refs/heads/main/node.svg\" align=\"top\" width=\"18\" height=\"21\"\u003e **Node** \u003csup\u003e[[docs](https://github.com/nodejs/undici/blob/main/docs/docs/api/ProxyAgent.md#example---proxyagent-with-fetch)]\u003c/sup\u003e\n\n```ts\nimport ImageKit from '@imagekit/nodejs';\nimport * as undici from 'undici';\n\nconst proxyAgent = new undici.ProxyAgent('http://localhost:8888');\nconst client = new ImageKit({\n  fetchOptions: {\n    dispatcher: proxyAgent,\n  },\n});\n```\n\n\u003cimg src=\"https://raw.githubusercontent.com/stainless-api/sdk-assets/refs/heads/main/bun.svg\" align=\"top\" width=\"18\" height=\"21\"\u003e **Bun** \u003csup\u003e[[docs](https://bun.sh/guides/http/proxy)]\u003c/sup\u003e\n\n```ts\nimport ImageKit from '@imagekit/nodejs';\n\nconst client = new ImageKit({\n  fetchOptions: {\n    proxy: 'http://localhost:8888',\n  },\n});\n```\n\n\u003cimg src=\"https://raw.githubusercontent.com/stainless-api/sdk-assets/refs/heads/main/deno.svg\" align=\"top\" width=\"18\" height=\"21\"\u003e **Deno** \u003csup\u003e[[docs](https://docs.deno.com/api/deno/~/Deno.createHttpClient)]\u003c/sup\u003e\n\n```ts\nimport ImageKit from 'npm:@imagekit/nodejs';\n\nconst httpClient = Deno.createHttpClient({ proxy: { url: 'http://localhost:8888' } });\nconst client = new ImageKit({\n  fetchOptions: {\n    client: httpClient,\n  },\n});\n```\n\n## Semantic versioning\n\nThis package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions, though certain backwards-incompatible changes may be released as minor versions:\n\n1. Changes that only affect static types, without breaking runtime behavior.\n2. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals.)_\n3. Changes that we do not expect to impact the vast majority of users in practice.\n\nWe take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.\n\nWe are keen for your feedback; please open an [issue](https://www.github.com/imagekit-developer/imagekit-nodejs/issues) with questions, bugs, or suggestions.\n\n## Requirements\n\nTypeScript \u003e= 4.9 is supported.\n\nThe following runtimes are supported:\n\n- Web browsers (Up-to-date Chrome, Firefox, Safari, Edge, and more)\n- Node.js 20 LTS or later ([non-EOL](https://endoflife.date/nodejs)) versions.\n- Deno v1.28.0 or higher.\n- Bun 1.0 or later.\n- Cloudflare Workers.\n- Vercel Edge Runtime.\n- Jest 28 or greater with the `\"node\"` environment (`\"jsdom\"` is not supported at this time).\n- Nitro v2.6 or greater.\n\nNote that React Native is not supported at this time.\n\nIf you are interested in other runtime environments, please open or upvote an issue on GitHub.\n\n## Contributing\n\nSee [the contributing documentation](./CONTRIBUTING.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimagekit-developer%2Fimagekit-nodejs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fimagekit-developer%2Fimagekit-nodejs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimagekit-developer%2Fimagekit-nodejs/lists"}