{"id":33914598,"url":"https://github.com/imagekit-developer/imagekit-ruby","last_synced_at":"2026-05-17T05:05:11.670Z","repository":{"id":37453564,"uuid":"249638691","full_name":"imagekit-developer/imagekit-ruby","owner":"imagekit-developer","description":"Ruby On Rails SDK for ImageKit.io API.","archived":false,"fork":false,"pushed_at":"2026-05-12T19:08:43.000Z","size":2060,"stargazers_count":19,"open_issues_count":2,"forks_count":8,"subscribers_count":6,"default_branch":"master","last_synced_at":"2026-05-12T21:10:05.971Z","etag":null,"topics":["image-manipulation","imagekit","rails-sdk"],"latest_commit_sha":null,"homepage":"https://imagekit.io","language":"Ruby","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":"2020-03-24T07:17:36.000Z","updated_at":"2026-04-26T01:36:25.000Z","dependencies_parsed_at":"2023-12-21T06:21:29.404Z","dependency_job_id":"3090c79b-62d1-4650-9ee9-40ab86f4385e","html_url":"https://github.com/imagekit-developer/imagekit-ruby","commit_stats":null,"previous_names":[],"tags_count":27,"template":false,"template_full_name":null,"purl":"pkg:github/imagekit-developer/imagekit-ruby","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imagekit-developer%2Fimagekit-ruby","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imagekit-developer%2Fimagekit-ruby/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imagekit-developer%2Fimagekit-ruby/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imagekit-developer%2Fimagekit-ruby/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/imagekit-developer","download_url":"https://codeload.github.com/imagekit-developer/imagekit-ruby/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imagekit-developer%2Fimagekit-ruby/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32981543,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-13T11:31:52.688Z","status":"ssl_error","status_checked_at":"2026-05-13T11:31:52.072Z","response_time":115,"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","rails-sdk"],"created_at":"2025-12-12T06:34:43.763Z","updated_at":"2026-05-13T12:00:52.340Z","avatar_url":"https://github.com/imagekit-developer.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ImageKit.io Ruby SDK\n\nThe ImageKit Ruby library provides convenient access to the ImageKit REST API from any Ruby 3.2.0+ application. The library supports building and transforming URLs, generating signed URLs for secure content delivery, and handling file uploads. It ships with comprehensive types \u0026 docstrings in Yard, RBS, and RBI – [see below](https://github.com/imagekit-developer/imagekit-ruby#Sorbet) for usage with Sorbet. The standard library's `net/http` is used as the HTTP transport, with connection pooling via the `connection_pool` gem.\n\n## Documentation\n\nThe official [ImageKit Ruby documentation](https://imagekit.io/docs/integration/ruby) provides complete integration guides and examples.\n\nIf you're using Ruby on Rails, the [ImageKit Rails gem](https://github.com/imagekit-developer/imagekit-rails) builds on top of this SDK to provide [Rails-specific integrations](https://imagekit.io/docs/integration/ruby/ruby-on-rails) including Active Storage and view helpers.\n\n## Table of Contents\n\n- [Documentation](#documentation)\n- [Installation](#installation)\n- [Usage](#usage)\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  - [Signed URLs for secure delivery](#signed-urls-for-secure-delivery)\n  - [Chained transformations](#chained-transformations)\n  - [Using raw parameter for custom transformations](#using-raw-parameter-for-custom-transformations)\n- [Helper Methods](#helper-methods)\n  - [Authentication parameters for client-side uploads](#authentication-parameters-for-client-side-uploads)\n  - [Responsive image attributes](#responsive-image-attributes)\n- [Webhook verification](#webhook-verification)\n- [Handling errors](#handling-errors)\n  - [Retries](#retries)\n  - [Timeouts](#timeouts)\n- [Advanced concepts](#advanced-concepts)\n  - [BaseModel](#basemodel)\n  - [Making custom or undocumented requests](#making-custom-or-undocumented-requests)\n  - [Concurrency \u0026 connection pooling](#concurrency--connection-pooling)\n- [Sorbet](#sorbet)\n  - [Enums](#enums)\n- [Versioning](#versioning)\n- [Requirements](#requirements)\n- [Contributing](#contributing)\n\n## Installation\n\nTo use this gem, install via Bundler by adding the following to your application's `Gemfile`:\n\n\u003c!-- x-release-please-start-version --\u003e\n\n```ruby\ngem \"imagekitio\", \"~\u003e 4.5.0\"\n```\n\n\u003c!-- x-release-please-end --\u003e\n\n## Usage\n\n```ruby\nrequire \"imagekitio\"\n\nimage_kit = Imagekitio::Client.new(\n  private_key: ENV[\"IMAGEKIT_PRIVATE_KEY\"], # This is the default and can be omitted\n)\n\nresponse = image_kit.files.upload(\n  file: Pathname(\"/path/to/file\"),\n  file_name: \"file-name.jpg\"\n)\n\nputs(response.file_id)\n```\n\n### File uploads\n\nRequest parameters that correspond to file uploads can be passed as raw contents, a [`Pathname`](https://rubyapi.org/3.2/o/pathname) instance, or an `IO` stream.\n\n```ruby\nrequire \"pathname\"\n\n# Use `Pathname` to stream from disk (memory efficient, supports retries):\nresponse = image_kit.files.upload(file: Pathname(\"/path/to/file\"))\n\n# Or pass file contents directly\nresponse = image_kit.files.upload(file: File.read(\"/path/to/file\"))\n\n# Or, to control the filename and/or content type:\nfile = Imagekitio::FilePart.new(File.read(\"/path/to/file\"), filename: \"/path/to/file\", content_type: \"…\")\nresponse = image_kit.files.upload(file: file)\n\nputs(response.file_id)\n```\n\nNote that you can also pass a raw `IO` descriptor, but this disables retries, as the library can't be sure if the descriptor is a file or pipe (which cannot be rewound).\n\n## URL Generation\n\nThe ImageKit SDK provides a powerful `helper.build_url()` 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```ruby\nrequire \"imagekitio\"\n\nimage_kit = Imagekitio::Client.new(\n  private_key: ENV[\"IMAGEKIT_PRIVATE_KEY\"]\n)\n\n# Basic URL without transformations\nurl = image_kit.helper.build_url({\n  src: \"/default-image.jpg\",\n  url_endpoint: \"https://ik.imagekit.io/your_imagekit_id\"\n})\n\nputs url\n# Output: https://ik.imagekit.io/your_imagekit_id/default-image.jpg\n```\n\nYou can also use absolute URLs:\n\n```ruby\nurl = image_kit.helper.build_url({\n  src: \"https://ik.imagekit.io/your_imagekit_id/default-image.jpg\",\n  url_endpoint: \"https://ik.imagekit.io/your_imagekit_id\"\n})\n```\n\n### URL generation with transformations\n\nApply common transformations like resizing, cropping, and format conversion:\n\n```ruby\n# URL with basic transformations\nurl = image_kit.helper.build_url({\n  src: \"/path/to/image.jpg\",\n  url_endpoint: \"https://ik.imagekit.io/your_imagekit_id\",\n  transformation: [\n    {\n      width: 400,\n      height: 300,\n      crop: :maintain_ratio,\n      quality: 80,\n      format_: :webp\n    }\n  ]\n})\n# Output: 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\nMore transformation examples:\n\n```ruby\n# Image resizing and cropping\nurl = image_kit.helper.build_url({\n  src: \"/product.jpg\",\n  url_endpoint: \"https://ik.imagekit.io/your_imagekit_id\",\n  transformation: [\n    {\n      width: 800,\n      height: 600,\n      crop: :at_max,\n      focus: \"auto\"\n    }\n  ]\n})\n\n# Image effects\nurl = image_kit.helper.build_url({\n  src: \"/photo.jpg\",\n  url_endpoint: \"https://ik.imagekit.io/your_imagekit_id\",\n  transformation: [\n    {\n      blur: 10,\n      grayscale: true,\n      radius: 20\n    }\n  ]\n})\n\n# Format and quality optimization\nurl = image_kit.helper.build_url({\n  src: \"/image.jpg\",\n  url_endpoint: \"https://ik.imagekit.io/your_imagekit_id\",\n  transformation: [\n    {\n      format_: :auto,\n      quality: 85,\n      progressive: true\n    }\n  ]\n})\n```\n\n### URL generation with image overlay\n\nAdd image overlays to your base image:\n\n```ruby\n# URL with image overlay\nurl = image_kit.helper.build_url({\n  src: \"/path/to/base-image.jpg\",\n  url_endpoint: \"https://ik.imagekit.io/your_imagekit_id\",\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# Output: 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```ruby\n# URL with text overlay\nurl = image_kit.helper.build_url({\n  src: \"/path/to/base-image.jpg\",\n  url_endpoint: \"https://ik.imagekit.io/your_imagekit_id\",\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            font_size: 40,\n            font_family: \"Arial\",\n            font_color: \"FFFFFF\",\n            typography: \"b\"  # bold\n          }\n        ]\n      }\n    }\n  ]\n})\n# Output: URL with bold white Arial text overlay at center position\n```\n\nYou can combine multiple overlays for complex compositions:\n\n```ruby\n# URL with multiple overlays (text + image)\nurl = image_kit.helper.build_url({\n  src: \"/path/to/base-image.jpg\",\n  url_endpoint: \"https://ik.imagekit.io/your_imagekit_id\",\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: [{ font_size: 30, font_color: \"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# Output: 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```ruby\n# Generate a signed URL that expires in 1 hour (3600 seconds)\nurl = image_kit.helper.build_url({\n  src: \"/private/secure-image.jpg\",\n  url_endpoint: \"https://ik.imagekit.io/your_imagekit_id\",\n  transformation: [\n    {\n      width: 400,\n      height: 300,\n      quality: 90\n    }\n  ],\n  signed: true,\n  expires_in: 3600  # URL expires in 1 hour\n})\n# Output: URL with signature parameters (?ik-t=timestamp\u0026ik-s=signature)\n\n# Generate a signed URL that doesn't expire\nurl = image_kit.helper.build_url({\n  src: \"/private/secure-image.jpg\",\n  url_endpoint: \"https://ik.imagekit.io/your_imagekit_id\",\n  signed: true\n  # No expires_in means the URL won't expire\n})\n# Output: URL with signature parameter (?ik-s=signature)\n```\n\n### Chained transformations\n\nApply multiple transformation steps by passing multiple transformation objects. Each transformation is applied sequentially:\n\n```ruby\n# First resize, then apply effects\nurl = image_kit.helper.build_url({\n  src: \"/default-image.jpg\",\n  url_endpoint: \"https://ik.imagekit.io/your_imagekit_id\",\n  transformation: [\n    {\n      width: 400,\n      height: 300\n    },\n    {\n      rotation: 90,\n      blur: 5\n    }\n  ]\n})\n# Output: https://ik.imagekit.io/your_imagekit_id/default-image.jpg?tr=w-400,h-300:rt-90,bl-5\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```ruby\n# Using raw parameter for custom transformations\nurl = image_kit.helper.build_url({\n  src: \"/path/to/image.jpg\",\n  url_endpoint: \"https://ik.imagekit.io/your_imagekit_id\",\n  transformation: [\n    {\n      width: 400,\n      height: 300,\n      raw: \"something-new\"\n    }\n  ]\n})\n# Output: https://ik.imagekit.io/your_imagekit_id/path/to/image.jpg?tr=w-400,h-300,something-new\n```\n\nYou can control where transformations appear in the URL:\n\n```ruby\n# Add transformations to the URL path instead of query parameters\nurl = image_kit.helper.build_url({\n  src: \"/default-image.jpg\",\n  url_endpoint: \"https://ik.imagekit.io/your_imagekit_id\",\n  transformation_position: :path,\n  transformation: [\n    {\n      width: 400,\n      height: 300\n    }\n  ]\n})\n# Output: https://ik.imagekit.io/your_imagekit_id/tr:w-400,h-300/default-image.jpg\n```\n\nAdd custom query parameters:\n\n```ruby\nurl = image_kit.helper.build_url({\n  src: \"/default-image.jpg\",\n  url_endpoint: \"https://ik.imagekit.io/your_imagekit_id\",\n  query_parameters: {\n    version: \"1\",\n    cache: \"max\"\n  }\n})\n```\n\n## Helper Methods\n\nThe SDK provides several helper methods for common ImageKit operations.\n\n### Authentication parameters for client-side uploads\n\nGenerate authentication parameters for secure client-side file uploads. These parameters allow you to securely upload files directly from the browser without exposing your private API key:\n\n```ruby\nrequire \"imagekitio\"\n\nimage_kit = Imagekitio::Client.new(\n  private_key: ENV[\"IMAGEKIT_PRIVATE_KEY\"]\n)\n\n# Generate authentication parameters with default expiry (30 minutes)\nauth_params = image_kit.helper.get_authentication_parameters\n\nputs auth_params\n# Output: { token: \"unique-token\", expire: 1234567890, signature: \"signature-hash\" }\n```\n\nCustomize the token and expiration:\n\n```ruby\n# Custom token and expiry (1 hour from now)\nauth_params = image_kit.helper.get_authentication_parameters(\n  token: \"my-custom-token\",\n  expire: Time.now.to_i + 3600\n)\n# Output: { token: \"my-custom-token\", expire: 1234567890, signature: \"generated-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### Responsive image attributes\n\nGenerate responsive image attributes for HTML `\u003cimg\u003e` tags. This creates optimized `srcset` and `sizes` attributes for responsive images:\n\n```ruby\n# Width-based responsive images (generates w descriptors)\nattrs = image_kit.helper.get_responsive_image_attributes({\n  src: \"/default-image.jpg\",\n  url_endpoint: \"https://ik.imagekit.io/your_imagekit_id\",\n  sizes: \"(min-width: 768px) 50vw, 100vw\",\n  transformation: [\n    {\n      quality: 80,\n      format_: :auto\n    }\n  ]\n})\n\nputs attrs.src\n# Largest candidate URL\n\nputs attrs.src_set\n# URL1 640w, URL2 750w, URL3 1080w, ...\n\nputs attrs.sizes\n# (min-width: 768px) 50vw, 100vw\n```\n\nDPR-based responsive images (generates x descriptors):\n\n```ruby\n# When width is provided without sizes, generates 1x and 2x variants\nattrs = image_kit.helper.get_responsive_image_attributes({\n  src: \"/profile.jpg\",\n  url_endpoint: \"https://ik.imagekit.io/your_imagekit_id\",\n  width: 400,\n  transformation: [\n    {\n      quality: 85\n    }\n  ]\n})\n\nputs attrs.src_set\n# URL1 1x, URL2 2x\n\nputs attrs.width\n# 400\n```\n\nCustom breakpoints for device widths:\n\n```ruby\nattrs = image_kit.helper.get_responsive_image_attributes({\n  src: \"/default-image.jpg\",\n  url_endpoint: \"https://ik.imagekit.io/your_imagekit_id\",\n  sizes: \"100vw\",\n  device_breakpoints: [320, 640, 1024, 1920],\n  image_breakpoints: [16, 32, 64],\n  transformation: [\n    {\n      crop: :at_max\n    }\n  ]\n})\n```\n\nThe returned attributes can be directly used in your HTML:\n\n```erb\n\u003cimg\n  src=\"\u003c%= attrs.src %\u003e\"\n  srcset=\"\u003c%= attrs.src_set %\u003e\"\n  sizes=\"\u003c%= attrs.sizes %\u003e\"\n  alt=\"Responsive image\"\n/\u003e\n```\n\nGenerate signed responsive image URLs:\n\n```ruby\n# Generate signed responsive image URLs\nattrs = image_kit.helper.get_responsive_image_attributes({\n  src: \"/default-image.jpg\",\n  url_endpoint: \"https://ik.imagekit.io/your_imagekit_id\",\n  sizes: \"100vw\",\n  signed: true,\n  expires_in: 3600,\n  transformation: [\n    {\n      quality: 80\n    }\n  ]\n})\n```\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\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, or if the API returns a non-success status code (i.e., 4xx or 5xx response), a subclass of `Imagekitio::Errors::APIError` will be thrown:\n\n```ruby\nbegin\n  file = image_kit.files.upload(\n    file: File.read(\"/path/to/file.jpg\"),\n    file_name: \"file-name.jpg\"\n  )\nrescue Imagekitio::Errors::APIConnectionError =\u003e e\n  puts(\"The server could not be reached\")\n  puts(e.cause)  # an underlying Exception, likely raised within `net/http`\nrescue Imagekitio::Errors::RateLimitError =\u003e e\n  puts(\"A 429 status code was received; we should back off a bit.\")\nrescue Imagekitio::Errors::APIStatusError =\u003e e\n  puts(\"Another non-200-range status code was received\")\n  puts(e.status)\nend\n```\n\nError codes are as follows:\n\n| Cause            | Error Type                 |\n| ---------------- | -------------------------- |\n| HTTP 400         | `BadRequestError`          |\n| HTTP 401         | `AuthenticationError`      |\n| HTTP 403         | `PermissionDeniedError`    |\n| HTTP 404         | `NotFoundError`            |\n| HTTP 409         | `ConflictError`            |\n| HTTP 422         | `UnprocessableEntityError` |\n| HTTP 429         | `RateLimitError`           |\n| HTTP \u003e= 500      | `InternalServerError`      |\n| Other HTTP error | `APIStatusError`           |\n| Timeout          | `APITimeoutError`          |\n| Network error    | `APIConnectionError`       |\n\n### Retries\n\nCertain errors will be automatically retried 2 times by default, with a short exponential backoff.\n\nConnection errors (for example, due to a network connectivity problem), 408 Request Timeout, 409 Conflict, 429 Rate Limit, \u003e=500 Internal errors, and timeouts will all be retried by default.\n\nYou can use the `max_retries` option to configure or disable this:\n\n```ruby\n# Configure the default for all requests:\nimage_kit = Imagekitio::Client.new(\n  max_retries: 0 # default is 2\n)\n\n# Or, configure per-request:\nimage_kit.files.upload(\n  file: File.read(\"/path/to/file.jpg\"),\n  file_name: \"file-name.jpg\",\n  request_options: {max_retries: 5}\n)\n```\n\n### Timeouts\n\nBy default, requests will time out after 60 seconds. You can use the timeout option to configure or disable this:\n\n```ruby\n# Configure the default for all requests:\nimage_kit = Imagekitio::Client.new(\n  timeout: nil # default is 60\n)\n\n# Or, configure per-request:\nimage_kit.files.upload(\n  file: File.read(\"/path/to/file.jpg\"),\n  file_name: \"file-name.jpg\",\n  request_options: {timeout: 5}\n)\n```\n\nOn timeout, `Imagekitio::Errors::APITimeoutError` is raised.\n\nNote that requests that time out are retried by default.\n\n## Advanced concepts\n\n### BaseModel\n\nAll parameter and response objects inherit from `Imagekitio::Internal::Type::BaseModel`, which provides several conveniences, including:\n\n1. All fields, including unknown ones, are accessible with `obj[:prop]` syntax, and can be destructured with `obj =\u003e {prop: prop}` or pattern-matching syntax.\n\n2. Structural equivalence for equality; if two API calls return the same values, comparing the responses with == will return true.\n\n3. Both instances and the classes themselves can be pretty-printed.\n\n4. Helpers such as `#to_h`, `#deep_to_h`, `#to_json`, and `#to_yaml`.\n\n### Making custom or undocumented requests\n\n#### Undocumented properties\n\nYou can send undocumented parameters to any endpoint, and read undocumented response properties, like so:\n\nNote: the `extra_` parameters of the same name overrides the documented parameters.\n\n```ruby\nresponse =\n  image_kit.files.upload(\n    file: File.read(\"/path/to/file.jpg\"),\n    file_name: \"file-name.jpg\",\n    request_options: {\n      extra_query: {my_query_parameter: value},\n      extra_body: {my_body_parameter: value},\n      extra_headers: {\"my-header\": value}\n    }\n  )\n\nputs(response[:my_undocumented_property])\n```\n\n#### Undocumented request params\n\nIf you want to explicitly send an extra param, you can do so with the `extra_query`, `extra_body`, and `extra_headers` under the `request_options:` parameter when making a request, as seen in the examples above.\n\n#### Undocumented endpoints\n\nTo make requests to undocumented endpoints while retaining the benefit of auth, retries, and so on, you can make requests using `client.request`, like so:\n\n```ruby\nresponse = client.request(\n  method: :post,\n  path: '/undocumented/endpoint',\n  query: {\"dog\": \"woof\"},\n  headers: {\"useful-header\": \"interesting-value\"},\n  body: {\"hello\": \"world\"}\n)\n```\n\n### Concurrency \u0026 connection pooling\n\nThe `Imagekitio::Client` instances are threadsafe, but are only are fork-safe when there are no in-flight HTTP requests.\n\nEach instance of `Imagekitio::Client` has its own HTTP connection pool with a default size of 99. As such, we recommend instantiating the client once per application in most settings.\n\nWhen all available connections from the pool are checked out, requests wait for a new connection to become available, with queue time counting towards the request timeout.\n\nUnless otherwise specified, other classes in the SDK do not have locks protecting their underlying data structure.\n\n## Sorbet\n\nThis library provides comprehensive [RBI](https://sorbet.org/docs/rbi) definitions, and has no dependency on sorbet-runtime.\n\nYou can provide typesafe request parameters like so:\n\n```ruby\nimage_kit.files.upload(\n  file: File.read(\"/path/to/file.jpg\"),\n  file_name: \"file-name.jpg\"\n)\n```\n\nOr, equivalently:\n\n```ruby\n# Hashes work, but are not typesafe:\nimage_kit.files.upload(\n  file: File.read(\"/path/to/file.jpg\"),\n  file_name: \"file-name.jpg\"\n)\n\n# You can also splat a full Params class:\nparams = Imagekitio::FileUploadParams.new(\n  file: File.read(\"/path/to/file.jpg\"),\n  file_name: \"file-name.jpg\"\n)\nimage_kit.files.upload(**params)\n```\n\n### Enums\n\nSince this library does not depend on `sorbet-runtime`, it cannot provide [`T::Enum`](https://sorbet.org/docs/tenum) instances. Instead, we provide \"tagged symbols\" instead, which is always a primitive at runtime:\n\n```ruby\n# :all\nputs(Imagekitio::AssetListParams::FileType::ALL)\n\n# Revealed type: `T.all(Imagekitio::AssetListParams::FileType, Symbol)`\nT.reveal_type(Imagekitio::AssetListParams::FileType::ALL)\n```\n\nEnum parameters have a \"relaxed\" type, so you can either pass in enum constants or their literal value:\n\n```ruby\n# Using the enum constants preserves the tagged type information:\nimage_kit.assets.list(\n  file_type: Imagekitio::AssetListParams::FileType::ALL,\n  # …\n)\n\n# Literal values are also permissible:\nimage_kit.assets.list(\n  file_type: :all,\n  # …\n)\n```\n\n## Versioning\n\nThis package follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions.\n\nThis package considers improvements to the (non-runtime) `*.rbi` and `*.rbs` type definitions to be non-breaking changes.\n\n## Requirements\n\nRuby 3.2.0 or higher.\n\n## Contributing\n\nSee [the contributing documentation](https://github.com/imagekit-developer/imagekit-ruby/tree/master/CONTRIBUTING.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimagekit-developer%2Fimagekit-ruby","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fimagekit-developer%2Fimagekit-ruby","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimagekit-developer%2Fimagekit-ruby/lists"}