{"id":37152483,"url":"https://github.com/imagekit-developer/imagekit-go","last_synced_at":"2026-05-13T12:00:52.723Z","repository":{"id":41539762,"uuid":"503646201","full_name":"imagekit-developer/imagekit-go","owner":"imagekit-developer","description":"Go SDK for ImageKit.io API.","archived":false,"fork":false,"pushed_at":"2026-05-06T20:42:15.000Z","size":2881,"stargazers_count":6,"open_issues_count":1,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2026-05-06T22:33:21.391Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","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":"2022-06-15T06:40:10.000Z","updated_at":"2026-04-13T02:03:45.000Z","dependencies_parsed_at":"2026-01-14T18:00:14.567Z","dependency_job_id":null,"html_url":"https://github.com/imagekit-developer/imagekit-go","commit_stats":{"total_commits":130,"total_committers":5,"mean_commits":26.0,"dds":0.1384615384615384,"last_synced_commit":"1d7e6e67fcd7b754cf085b49511892fad7a64db1"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/imagekit-developer/imagekit-go","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imagekit-developer%2Fimagekit-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imagekit-developer%2Fimagekit-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imagekit-developer%2Fimagekit-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imagekit-developer%2Fimagekit-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/imagekit-developer","download_url":"https://codeload.github.com/imagekit-developer/imagekit-go/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imagekit-developer%2Fimagekit-go/sbom","scorecard":{"id":484772,"data":{"date":"2025-08-11","repo":{"name":"github.com/imagekit-developer/imagekit-go","commit":"1d7e6e67fcd7b754cf085b49511892fad7a64db1"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.1,"checks":[{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/test-coverage.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Code-Review","score":1,"reason":"Found 3/23 approved changesets -- score normalized to 1","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test-coverage.yml:9: update your workflow using https://app.stepsecurity.io/secureworkflow/imagekit-developer/imagekit-go/test-coverage.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test-coverage.yml:12: update your workflow using https://app.stepsecurity.io/secureworkflow/imagekit-developer/imagekit-go/test-coverage.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/test-coverage.yml:18: update your workflow using https://app.stepsecurity.io/secureworkflow/imagekit-developer/imagekit-go/test-coverage.yml/master?enable=pin","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 third-party GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 10 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":9,"reason":"1 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GO-2022-0603 / GHSA-hp87-p4gw-j4gq"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-19T17:30:28.197Z","repository_id":41539762,"created_at":"2025-08-19T17:30:28.197Z","updated_at":"2025-08-19T17:30:28.197Z"},"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":[],"created_at":"2026-01-14T18:00:09.292Z","updated_at":"2026-05-13T12:00:52.712Z","avatar_url":"https://github.com/imagekit-developer.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ImageKit.io Go SDK\n\n\u003c!-- x-release-please-start-version --\u003e\n\n\u003ca href=\"https://pkg.go.dev/github.com/imagekit-developer/imagekit-go/v2\"\u003e\u003cimg src=\"https://pkg.go.dev/badge/github.com/imagekit-developer/imagekit-go.svg\" alt=\"Go Reference\"\u003e\u003c/a\u003e\n\n\u003c!-- x-release-please-end --\u003e\n\nThe ImageKit Go 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.\n\nThe full API of this library can be found in [api.md](api.md).\n\nFor additional details, refer to the [ImageKit REST API documentation](https://imagekit.io/docs/api-reference).\n\n## Table of Contents\n\n- [Installation](#installation)\n- [Requirements](#requirements)\n- [Usage](#usage)\n  - [Request fields](#request-fields)\n  - [Request unions](#request-unions)\n  - [Response objects](#response-objects)\n  - [Response Unions](#response-unions)\n  - [RequestOptions](#requestoptions)\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- [Authentication parameters for client-side uploads](#authentication-parameters-for-client-side-uploads)\n- [Webhook verification](#webhook-verification)\n- [Advanced Usage](#advanced-usage)\n  - [Errors](#errors)\n  - [Timeouts](#timeouts)\n  - [File uploads](#file-uploads)\n  - [Retries](#retries)\n  - [Accessing raw response data](#accessing-raw-response-data-eg-response-headers)\n  - [Making custom/undocumented requests](#making-customundocumented-requests)\n  - [Middleware](#middleware)\n- [Semantic versioning](#semantic-versioning)\n- [Contributing](#contributing)\n\n## Installation\n\n\u003c!-- x-release-please-start-version --\u003e\n\n```go\nimport (\n\t\"github.com/imagekit-developer/imagekit-go/v2\" // imported as imagekit\n)\n```\n\n\u003c!-- x-release-please-end --\u003e\n\nOr to pin the version:\n\n\u003c!-- x-release-please-start-version --\u003e\n\n```sh\ngo get -u 'github.com/imagekit-developer/imagekit-go/v2@v2.5.0'\n```\n\n\u003c!-- x-release-please-end --\u003e\n\n## Requirements\n\nThis library requires Go 1.22+.\n\n## Usage\n\nThe full API of this library can be found in [api.md](api.md).\n\n```go\npackage main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\n\t\"github.com/imagekit-developer/imagekit-go/v2\"\n\t\"github.com/imagekit-developer/imagekit-go/v2/option\"\n)\n\nfunc main() {\n\tclient := imagekit.NewClient(\n\t\toption.WithPrivateKey(\"private_key_xxx\"), // defaults to os.LookupEnv(\"IMAGEKIT_PRIVATE_KEY\")\n\t)\n\t\n\tfile, err := os.Open(\"/path/to/your/image.jpg\")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tdefer file.Close()\n\t\n\tresponse, err := client.Files.Upload(context.TODO(), imagekit.FileUploadParams{\n\t\tFile:     file,\n\t\tFileName: \"uploaded-image.jpg\",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", response)\n}\n\n```\n\n### Request fields\n\nThe imagekit library uses the [`omitzero`](https://tip.golang.org/doc/go1.24#encodingjsonpkgencodingjson)\nsemantics from the Go 1.24+ `encoding/json` release for request fields.\n\nRequired primitive fields (`int64`, `string`, etc.) feature the tag \u003ccode\u003e\\`api:\"required\"\\`\u003c/code\u003e. These\nfields are always serialized, even their zero values.\n\nOptional primitive types are wrapped in a `param.Opt[T]`. These fields can be set with the provided constructors, `imagekit.String(string)`, `imagekit.Int(int64)`, etc.\n\nAny `param.Opt[T]`, map, slice, struct or string enum uses the\ntag \u003ccode\u003e\\`json:\"...,omitzero\"\\`\u003c/code\u003e. Its zero value is considered omitted.\n\nThe `param.IsOmitted(any)` function can confirm the presence of any `omitzero` field.\n\n```go\np := imagekit.ExampleParams{\n\tID:   \"id_xxx\",               // required property\n\tName: imagekit.String(\"...\"), // optional property\n\n\tPoint: imagekit.Point{\n\t\tX: 0,               // required field will serialize as 0\n\t\tY: imagekit.Int(1), // optional field will serialize as 1\n\t\t// ... omitted non-required fields will not be serialized\n\t},\n\n\tOrigin: imagekit.Origin{}, // the zero value of [Origin] is considered omitted\n}\n```\n\nTo send `null` instead of a `param.Opt[T]`, use `param.Null[T]()`.\nTo send `null` instead of a struct `T`, use `param.NullStruct[T]()`.\n\n```go\np.Name = param.Null[string]()       // 'null' instead of string\np.Point = param.NullStruct[Point]() // 'null' instead of struct\n\nparam.IsNull(p.Name)  // true\nparam.IsNull(p.Point) // true\n```\n\nRequest structs contain a `.SetExtraFields(map[string]any)` method which can send non-conforming\nfields in the request body. Extra fields overwrite any struct fields with a matching\nkey. For security reasons, only use `SetExtraFields` with trusted data.\n\nTo send a custom value instead of a struct, use `param.Override[T](value)`.\n\n```go\n// In cases where the API specifies a given type,\n// but you want to send something else, use [SetExtraFields]:\np.SetExtraFields(map[string]any{\n\t\"x\": 0.01, // send \"x\" as a float instead of int\n})\n\n// Send a number instead of an object\ncustom := param.Override[imagekit.FooParams](12)\n```\n\n### Request unions\n\nUnions are represented as a struct with fields prefixed by \"Of\" for each of its variants,\nonly one field can be non-zero. The non-zero field will be serialized.\n\nSub-properties of the union can be accessed via methods on the union struct.\nThese methods return a mutable pointer to the underlying data, if present.\n\n```go\n// Only one field can be non-zero, use param.IsOmitted() to check if a field is set\ntype AnimalUnionParam struct {\n\tOfCat *Cat `json:\",omitzero,inline`\n\tOfDog *Dog `json:\",omitzero,inline`\n}\n\nanimal := AnimalUnionParam{\n\tOfCat: \u0026Cat{\n\t\tName: \"Whiskers\",\n\t\tOwner: PersonParam{\n\t\t\tAddress: AddressParam{Street: \"3333 Coyote Hill Rd\", Zip: 0},\n\t\t},\n\t},\n}\n\n// Mutating a field\nif address := animal.GetOwner().GetAddress(); address != nil {\n\taddress.ZipCode = 94304\n}\n```\n\n### Response objects\n\nAll fields in response structs are ordinary value types (not pointers or wrappers).\nResponse structs also include a special `JSON` field containing metadata about\neach property.\n\n```go\ntype Animal struct {\n\tName   string `json:\"name,nullable\"`\n\tOwners int    `json:\"owners\"`\n\tAge    int    `json:\"age\"`\n\tJSON   struct {\n\t\tName        respjson.Field\n\t\tOwner       respjson.Field\n\t\tAge         respjson.Field\n\t\tExtraFields map[string]respjson.Field\n\t} `json:\"-\"`\n}\n```\n\nTo handle optional data, use the `.Valid()` method on the JSON field.\n`.Valid()` returns true if a field is not `null`, not present, or couldn't be marshaled.\n\nIf `.Valid()` is false, the corresponding field will simply be its zero value.\n\n```go\nraw := `{\"owners\": 1, \"name\": null}`\n\nvar res Animal\njson.Unmarshal([]byte(raw), \u0026res)\n\n// Accessing regular fields\n\nres.Owners // 1\nres.Name   // \"\"\nres.Age    // 0\n\n// Optional field checks\n\nres.JSON.Owners.Valid() // true\nres.JSON.Name.Valid()   // false\nres.JSON.Age.Valid()    // false\n\n// Raw JSON values\n\nres.JSON.Owners.Raw()                  // \"1\"\nres.JSON.Name.Raw() == \"null\"          // true\nres.JSON.Name.Raw() == respjson.Null   // true\nres.JSON.Age.Raw() == \"\"               // true\nres.JSON.Age.Raw() == respjson.Omitted // true\n```\n\nThese `.JSON` structs also include an `ExtraFields` map containing\nany properties in the json response that were not specified\nin the struct. This can be useful for API features not yet\npresent in the SDK.\n\n```go\nbody := res.JSON.ExtraFields[\"my_unexpected_field\"].Raw()\n```\n\n### Response Unions\n\nIn responses, unions are represented by a flattened struct containing all possible fields from each of the\nobject variants.\nTo convert it to a variant use the `.AsFooVariant()` method or the `.AsAny()` method if present.\n\nIf a response value union contains primitive values, primitive fields will be alongside\nthe properties but prefixed with `Of` and feature the tag `json:\"...,inline\"`.\n\n```go\ntype AnimalUnion struct {\n\t// From variants [Dog], [Cat]\n\tOwner Person `json:\"owner\"`\n\t// From variant [Dog]\n\tDogBreed string `json:\"dog_breed\"`\n\t// From variant [Cat]\n\tCatBreed string `json:\"cat_breed\"`\n\t// ...\n\n\tJSON struct {\n\t\tOwner respjson.Field\n\t\t// ...\n\t} `json:\"-\"`\n}\n\n// If animal variant\nif animal.Owner.Address.ZipCode == \"\" {\n\tpanic(\"missing zip code\")\n}\n\n// Switch on the variant\nswitch variant := animal.AsAny().(type) {\ncase Dog:\ncase Cat:\ndefault:\n\tpanic(\"unexpected type\")\n}\n```\n\n### RequestOptions\n\nThis library uses the functional options pattern. Functions defined in the\n`option` package return a `RequestOption`, which is a closure that mutates a\n`RequestConfig`. These options can be supplied to the client or at individual\nrequests. For example:\n\n```go\nclient := imagekit.NewClient(\n\t// Adds a header to every request made by the client\n\toption.WithHeader(\"X-Some-Header\", \"custom_header_info\"),\n)\n\nclient.Files.Upload(context.TODO(), ...,\n\t// Override the header\n\toption.WithHeader(\"X-Some-Header\", \"some_other_custom_header_info\"),\n\t// Add an undocumented field to the request body, using sjson syntax\n\toption.WithJSONSet(\"some.json.path\", map[string]string{\"my\": \"object\"}),\n)\n```\n\nThe request option `option.WithDebugLog(nil)` may be helpful while debugging.\n\nSee the [full list of request options](https://pkg.go.dev/github.com/imagekit-developer/imagekit-go/option).\n\n## URL generation\n\nThe ImageKit SDK provides a powerful `Helper.BuildURL()` 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```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\n\t\"github.com/imagekit-developer/imagekit-go/v2\"\n\t\"github.com/imagekit-developer/imagekit-go/v2/option\"\n\t\"github.com/imagekit-developer/imagekit-go/v2/shared\"\n)\n\nfunc main() {\n\tclient := imagekit.NewClient(\n\t\toption.WithPrivateKey(\"private_key_xxx\"),\n\t)\n\n\t// Basic URL without transformations\n\turl := client.Helper.BuildURL(shared.SrcOptionsParam{\n\t\tURLEndpoint: \"https://ik.imagekit.io/your_imagekit_id\",\n\t\tSrc:         \"/path/to/image.jpg\",\n\t})\n\tfmt.Println(url)\n\t// Result: https://ik.imagekit.io/your_imagekit_id/path/to/image.jpg\n}\n```\n\n### URL generation with transformations\n\nApply common transformations like resizing, cropping, and format conversion:\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\n\t\"github.com/imagekit-developer/imagekit-go/v2\"\n\t\"github.com/imagekit-developer/imagekit-go/v2/option\"\n\t\"github.com/imagekit-developer/imagekit-go/v2/packages/param\"\n\t\"github.com/imagekit-developer/imagekit-go/v2/shared\"\n)\n\nfunc main() {\n\tclient := imagekit.NewClient(\n\t\toption.WithPrivateKey(\"private_key_xxx\"),\n\t)\n\n\t// URL with basic transformations\n\turl := client.Helper.BuildURL(shared.SrcOptionsParam{\n\t\tURLEndpoint: \"https://ik.imagekit.io/your_imagekit_id\",\n\t\tSrc:         \"/path/to/image.jpg\",\n\t\tTransformation: []shared.TransformationParam{\n\t\t\t{\n\t\t\t\tWidth: shared.TransformationWidthUnionParam{\n\t\t\t\t\tOfFloat: param.Opt[float64]{Value: 400},\n\t\t\t\t},\n\t\t\t\tHeight: shared.TransformationHeightUnionParam{\n\t\t\t\t\tOfFloat: param.Opt[float64]{Value: 300},\n\t\t\t\t},\n\t\t\t\tCrop:    shared.TransformationCropMaintainRatio,\n\t\t\t\tQuality:  param.Opt[float64]{Value: 80},\n\t\t\t\tFormat:   shared.TransformationFormatWebp,\n\t\t\t},\n\t\t},\n\t})\n\tfmt.Println(url)\n\t// 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\n### URL generation with image overlay\n\nAdd image overlays to your base image:\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\n\t\"github.com/imagekit-developer/imagekit-go/v2\"\n\t\"github.com/imagekit-developer/imagekit-go/v2/option\"\n\t\"github.com/imagekit-developer/imagekit-go/v2/packages/param\"\n\t\"github.com/imagekit-developer/imagekit-go/v2/shared\"\n\t\"github.com/imagekit-developer/imagekit-go/v2/shared/constant\"\n)\n\nfunc main() {\n\tclient := imagekit.NewClient(\n\t\toption.WithPrivateKey(\"private_key_xxx\"),\n\t)\n\n\t// URL with image overlay\n\turl := client.Helper.BuildURL(shared.SrcOptionsParam{\n\t\tURLEndpoint: \"https://ik.imagekit.io/your_imagekit_id\",\n\t\tSrc:         \"/path/to/base-image.jpg\",\n\t\tTransformation: []shared.TransformationParam{\n\t\t\t{\n\t\t\t\tWidth: shared.TransformationWidthUnionParam{\n\t\t\t\t\tOfFloat: param.Opt[float64]{Value: 500},\n\t\t\t\t},\n\t\t\t\tHeight: shared.TransformationHeightUnionParam{\n\t\t\t\t\tOfFloat: param.Opt[float64]{Value: 400},\n\t\t\t\t},\n\t\t\t\tOverlay: shared.OverlayUnionParam{\n\t\t\t\t\tOfImage: \u0026shared.ImageOverlayParam{\n\t\t\t\t\t\tType:  constant.Image(\"image\"),\n\t\t\t\t\t\tInput: \"/path/to/overlay-logo.png\",\n\t\t\t\t\t\tBaseOverlayParam: shared.BaseOverlayParam{\n\t\t\t\t\t\t\tPosition: shared.OverlayPositionParam{\n\t\t\t\t\t\t\t\tX: shared.OverlayPositionXUnionParam{\n\t\t\t\t\t\t\t\t\tOfFloat: param.Opt[float64]{Value: 10},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tY: shared.OverlayPositionYUnionParam{\n\t\t\t\t\t\t\t\t\tOfFloat: param.Opt[float64]{Value: 10},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t\tTransformation: []shared.TransformationParam{\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tWidth: shared.TransformationWidthUnionParam{\n\t\t\t\t\t\t\t\t\tOfFloat: param.Opt[float64]{Value: 100},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tHeight: shared.TransformationHeightUnionParam{\n\t\t\t\t\t\t\t\t\tOfFloat: param.Opt[float64]{Value: 50},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t})\n\tfmt.Println(url)\n\t// Result: URL with image overlay positioned at x:10, y:10\n}\n```\n\n### URL generation with text overlay\n\nAdd customized text overlays:\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\n\t\"github.com/imagekit-developer/imagekit-go/v2\"\n\t\"github.com/imagekit-developer/imagekit-go/v2/option\"\n\t\"github.com/imagekit-developer/imagekit-go/v2/packages/param\"\n\t\"github.com/imagekit-developer/imagekit-go/v2/shared\"\n\t\"github.com/imagekit-developer/imagekit-go/v2/shared/constant\"\n)\n\nfunc main() {\n\tclient := imagekit.NewClient(\n\t\toption.WithPrivateKey(\"private_key_xxx\"),\n\t)\n\n\t// URL with text overlay\n\turl := client.Helper.BuildURL(shared.SrcOptionsParam{\n\t\tURLEndpoint: \"https://ik.imagekit.io/your_imagekit_id\",\n\t\tSrc:         \"/path/to/base-image.jpg\",\n\t\tTransformation: []shared.TransformationParam{\n\t\t\t{\n\t\t\t\tWidth: shared.TransformationWidthUnionParam{\n\t\t\t\t\tOfFloat: param.Opt[float64]{Value: 600},\n\t\t\t\t},\n\t\t\t\tHeight: shared.TransformationHeightUnionParam{\n\t\t\t\t\tOfFloat: param.Opt[float64]{Value: 400},\n\t\t\t\t},\n\t\t\t\tOverlay: shared.OverlayUnionParam{\n\t\t\t\t\tOfText: \u0026shared.TextOverlayParam{\n\t\t\t\t\t\tType: constant.Text(\"text\"),\n\t\t\t\t\t\tText: \"Sample Text Overlay\",\n\t\t\t\t\t\tBaseOverlayParam: shared.BaseOverlayParam{\n\t\t\t\t\t\t\tPosition: shared.OverlayPositionParam{\n\t\t\t\t\t\t\t\tX: shared.OverlayPositionXUnionParam{\n\t\t\t\t\t\t\t\t\tOfFloat: param.Opt[float64]{Value: 50},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tY: shared.OverlayPositionYUnionParam{\n\t\t\t\t\t\t\t\t\tOfFloat: param.Opt[float64]{Value: 50},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tFocus: shared.OverlayPositionFocusCenter,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t\tTransformation: []shared.TextOverlayTransformationParam{\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tFontSize: shared.TextOverlayTransformationFontSizeUnionParam{\n\t\t\t\t\t\t\t\t\tOfFloat: param.Opt[float64]{Value: 40},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tFontFamily: param.Opt[string]{Value: \"Arial\"},\n\t\t\t\t\t\t\t\tFontColor:  param.Opt[string]{Value: \"FFFFFF\"},\n\t\t\t\t\t\t\t\tTypography: param.Opt[string]{Value: \"b\"}, // bold\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t})\n\tfmt.Println(url)\n\t// Result: URL with bold white Arial text overlay at center position\n}\n```\n\n### URL generation with multiple overlays\n\nCombine multiple overlays for complex compositions:\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\n\t\"github.com/imagekit-developer/imagekit-go/v2\"\n\t\"github.com/imagekit-developer/imagekit-go/v2/option\"\n\t\"github.com/imagekit-developer/imagekit-go/v2/packages/param\"\n\t\"github.com/imagekit-developer/imagekit-go/v2/shared\"\n\t\"github.com/imagekit-developer/imagekit-go/v2/shared/constant\"\n)\n\nfunc main() {\n\tclient := imagekit.NewClient(\n\t\toption.WithPrivateKey(\"private_key_xxx\"),\n\t)\n\n\t// URL with multiple overlays (text + image)\n\turl := client.Helper.BuildURL(shared.SrcOptionsParam{\n\t\tURLEndpoint: \"https://ik.imagekit.io/your_imagekit_id\",\n\t\tSrc:         \"/path/to/base-image.jpg\",\n\t\tTransformation: []shared.TransformationParam{\n\t\t\t{\n\t\t\t\tWidth: shared.TransformationWidthUnionParam{\n\t\t\t\t\tOfFloat: param.Opt[float64]{Value: 800},\n\t\t\t\t},\n\t\t\t\tHeight: shared.TransformationHeightUnionParam{\n\t\t\t\t\tOfFloat: param.Opt[float64]{Value: 600},\n\t\t\t\t},\n\t\t\t\tOverlay: shared.OverlayUnionParam{\n\t\t\t\t\tOfText: \u0026shared.TextOverlayParam{\n\t\t\t\t\t\tType: constant.Text(\"text\"),\n\t\t\t\t\t\tText: \"Header Text\",\n\t\t\t\t\t\tBaseOverlayParam: shared.BaseOverlayParam{\n\t\t\t\t\t\t\tPosition: shared.OverlayPositionParam{\n\t\t\t\t\t\t\t\tX: shared.OverlayPositionXUnionParam{\n\t\t\t\t\t\t\t\t\tOfFloat: param.Opt[float64]{Value: 20},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tY: shared.OverlayPositionYUnionParam{\n\t\t\t\t\t\t\t\t\tOfFloat: param.Opt[float64]{Value: 20},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t\tTransformation: []shared.TextOverlayTransformationParam{\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tFontSize: shared.TextOverlayTransformationFontSizeUnionParam{\n\t\t\t\t\t\t\t\t\tOfFloat: param.Opt[float64]{Value: 30},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tFontColor: param.Opt[string]{Value: \"000000\"},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tOverlay: shared.OverlayUnionParam{\n\t\t\t\t\tOfImage: \u0026shared.ImageOverlayParam{\n\t\t\t\t\t\tType:  constant.Image(\"image\"),\n\t\t\t\t\t\tInput: \"/watermark.png\",\n\t\t\t\t\t\tBaseOverlayParam: shared.BaseOverlayParam{\n\t\t\t\t\t\t\tPosition: shared.OverlayPositionParam{\n\t\t\t\t\t\t\t\tFocus: shared.OverlayPositionFocusBottomRight,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t\tTransformation: []shared.TransformationParam{\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tWidth: shared.TransformationWidthUnionParam{\n\t\t\t\t\t\t\t\t\tOfFloat: param.Opt[float64]{Value: 100},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tOpacity: param.Opt[float64]{Value: 70},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t})\n\tfmt.Println(url)\n\t// Result: URL with text overlay at top-left and semi-transparent watermark at bottom-right\n}\n```\n\n### Signed URLs for secure delivery\n\nGenerate signed URLs that expire after a specified time for secure content delivery:\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\n\t\"github.com/imagekit-developer/imagekit-go/v2\"\n\t\"github.com/imagekit-developer/imagekit-go/v2/option\"\n\t\"github.com/imagekit-developer/imagekit-go/v2/packages/param\"\n\t\"github.com/imagekit-developer/imagekit-go/v2/shared\"\n)\n\nfunc main() {\n\tclient := imagekit.NewClient(\n\t\toption.WithPrivateKey(\"private_key_xxx\"),\n\t)\n\n\t// Generate a signed URL that expires in 1 hour (3600 seconds)\n\turl := client.Helper.BuildURL(shared.SrcOptionsParam{\n\t\tURLEndpoint: \"https://ik.imagekit.io/your_imagekit_id\",\n\t\tSrc:         \"/private/secure-image.jpg\",\n\t\tTransformation: []shared.TransformationParam{\n\t\t\t{\n\t\t\t\tWidth: shared.TransformationWidthUnionParam{\n\t\t\t\t\tOfFloat: param.Opt[float64]{Value: 400},\n\t\t\t\t},\n\t\t\t\tHeight: shared.TransformationHeightUnionParam{\n\t\t\t\t\tOfFloat: param.Opt[float64]{Value: 300},\n\t\t\t\t},\n\t\t\t\tQuality: param.Opt[float64]{Value: 90},\n\t\t\t},\n\t\t},\n\t\tSigned:    param.Opt[bool]{Value: true},\n\t\tExpiresIn: param.Opt[float64]{Value: 3600}, // URL expires in 1 hour\n\t})\n\tfmt.Println(url)\n\t// Result: URL with signature parameters (?ik-t=timestamp\u0026ik-s=signature)\n\n\t// Generate a signed URL that doesn't expire\n\tpermanentSignedUrl := client.Helper.BuildURL(shared.SrcOptionsParam{\n\t\tURLEndpoint: \"https://ik.imagekit.io/your_imagekit_id\",\n\t\tSrc:         \"/private/secure-image.jpg\",\n\t\tSigned:      param.Opt[bool]{Value: true},\n\t\t// No ExpiresIn means the URL won't expire\n\t})\n\tfmt.Println(permanentSignedUrl)\n\t// Result: URL with signature parameter (?ik-s=signature)\n}\n```\n\n### Using Raw transformations for undocumented features\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```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\n\t\"github.com/imagekit-developer/imagekit-go/v2\"\n\t\"github.com/imagekit-developer/imagekit-go/v2/option\"\n\t\"github.com/imagekit-developer/imagekit-go/v2/packages/param\"\n\t\"github.com/imagekit-developer/imagekit-go/v2/shared\"\n)\n\nfunc main() {\n\tclient := imagekit.NewClient(\n\t\toption.WithPrivateKey(\"private_key_xxx\"),\n\t)\n\n\t// Using Raw transformation for undocumented or new parameters\n\turl := client.Helper.BuildURL(shared.SrcOptionsParam{\n\t\tURLEndpoint: \"https://ik.imagekit.io/your_imagekit_id\",\n\t\tSrc:         \"/path/to/image.jpg\",\n\t\tTransformation: []shared.TransformationParam{\n\t\t\t{\n\t\t\t\t// Combine documented transformations with raw parameters\n\t\t\t\tWidth: shared.TransformationWidthUnionParam{\n\t\t\t\t\tOfFloat: param.Opt[float64]{Value: 400},\n\t\t\t\t},\n\t\t\t\tHeight: shared.TransformationHeightUnionParam{\n\t\t\t\t\tOfFloat: param.Opt[float64]{Value: 300},\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\t// Use Raw for undocumented transformations or complex parameters\n\t\t\t\tRaw: param.Opt[string]{Value: \"something-new\"},\n\t\t\t},\n\t\t},\n\t})\n\tfmt.Println(url)\n\t// Result: https://ik.imagekit.io/your_imagekit_id/path/to/image.jpg?tr=w-400,h-300:something-new\n}\n```\n\n## Authentication parameters for client-side uploads\n\nGenerate authentication parameters for secure client-side file uploads:\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\n\t\"github.com/imagekit-developer/imagekit-go/v2\"\n\t\"github.com/imagekit-developer/imagekit-go/v2/option\"\n)\n\nfunc main() {\n\tclient := imagekit.NewClient(\n\t\toption.WithPrivateKey(\"private_key_xxx\"),\n\t)\n\n\t// Generate authentication parameters for client-side uploads\n\tauthParams := client.Helper.GetAuthenticationParameters(\"\", 0)\n\tfmt.Printf(\"%+v\\n\", authParams)\n\t// Result: map[expire:\u003ctimestamp\u003e signature:\u003chmac-signature\u003e token:\u003cuuid-token\u003e]\n\n\t// Generate with custom token and expiry\n\tcustomAuthParams := client.Helper.GetAuthenticationParameters(\"my-custom-token\", 1800)\n\tfmt.Printf(\"%+v\\n\", customAuthParams)\n\t// Result: map[expire:1800 signature:\u003chmac-signature\u003e token:my-custom-token]\n}\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\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## Advanced Usage\n\n### Errors\n\nWhen the API returns a non-success status code, we return an error with type\n`*imagekit.Error`. This contains the `StatusCode`, `*http.Request`, and\n`*http.Response` values of the request, as well as the JSON of the error body\n(much like other response objects in the SDK).\n\nTo handle errors, we recommend that you use the `errors.As` pattern:\n\n```go\nfile, err := os.Open(\"/path/to/your/image.jpg\")\nif err != nil {\n\tpanic(err.Error())\n}\ndefer file.Close()\n\n_, err = client.Files.Upload(context.TODO(), imagekit.FileUploadParams{\n\tFile:     file,\n\tFileName: \"uploaded-image.jpg\",\n})\nif err != nil {\n\tvar apierr *imagekit.Error\n\tif errors.As(err, \u0026apierr) {\n\t\tprintln(string(apierr.DumpRequest(true)))  // Prints the serialized HTTP request\n\t\tprintln(string(apierr.DumpResponse(true))) // Prints the serialized HTTP response\n\t}\n\tpanic(err.Error()) // GET \"/api/v1/files/upload\": 400 Bad Request { ... }\n}\n```\n\nWhen other errors occur, they are returned unwrapped; for example,\nif HTTP transport fails, you might receive `*url.Error` wrapping `*net.OpError`.\n\n### Timeouts\n\nRequests do not time out by default; use context to configure a timeout for a request lifecycle.\n\nNote that if a request is [retried](#retries), the context timeout does not start over.\nTo set a per-retry timeout, use `option.WithRequestTimeout()`.\n\n```go\n// This sets the timeout for the request, including all the retries.\nctx, cancel := context.WithTimeout(context.Background(), 5*time.Minute)\ndefer cancel()\n\nfile, err := os.Open(\"/path/to/your/image.jpg\")\nif err != nil {\n\tpanic(err.Error())\n}\ndefer file.Close()\n\nclient.Files.Upload(\n\tctx,\n\timagekit.FileUploadParams{\n\t\tFile:     file,\n\t\tFileName: \"uploaded-image.jpg\",\n\t},\n\t// This sets the per-retry timeout\n\toption.WithRequestTimeout(20*time.Second),\n)\n```\n\n### File uploads\n\nRequest parameters that correspond to file uploads in multipart requests are typed as\n`io.Reader`. The contents of the `io.Reader` will by default be sent as a multipart form\npart with the file name of \"anonymous_file\" and content-type of \"application/octet-stream\".\n\nThe file name and content-type can be customized by implementing `Name() string` or `ContentType()\nstring` on the run-time type of `io.Reader`. Note that `os.File` implements `Name() string`, so a\nfile returned by `os.Open` will be sent with the file name on disk.\n\nWe also provide a helper `imagekit.NewFile(reader io.Reader, filename string, contentType string)`\nwhich can be used to wrap any `io.Reader` with the appropriate file name and content type.\n\nHere are common file upload patterns:\n\n```go\n// Upload from local file system\nfile, err := os.Open(\"/path/to/your/image.jpg\")\nif err != nil {\n\tpanic(err.Error())\n}\ndefer file.Close()\n\nresponse, err := client.Files.Upload(context.TODO(), imagekit.FileUploadParams{\n\tFile:     file,\n\tFileName: \"uploaded-image.jpg\",\n})\n\n// Upload from remote URL\nresp, err := http.Get(\"https://example.com/remote-image.jpg\")\nif err != nil {\n\tpanic(err.Error())\n}\ndefer resp.Body.Close()\n\nif resp.StatusCode != http.StatusOK {\n\tpanic(\"Failed to fetch remote image\")\n}\n\nresponse, err := client.Files.Upload(context.TODO(), imagekit.FileUploadParams{\n\tFile:     resp.Body,\n\tFileName: \"remote-image.jpg\",\n})\n\n// Upload from binary data\nimageData := []byte{/* your binary data */}\nresponse, err := client.Files.Upload(context.TODO(), imagekit.FileUploadParams{\n\tFile:     bytes.NewReader(imageData),\n\tFileName: \"binary-upload.jpg\",\n})\n\n// Upload with custom content type\nresponse, err := client.Files.Upload(context.TODO(), imagekit.FileUploadParams{\n\tFile:     imagekit.NewFile(bytes.NewReader(imageData), \"custom.jpg\", \"image/jpeg\"),\n\tFileName: \"custom-upload.jpg\",\n})\n```\n\n### Retries\n\nCertain errors will be automatically retried 2 times by default, with a short exponential backoff.\nWe retry by default all connection errors, 408 Request Timeout, 409 Conflict, 429 Rate Limit,\nand \u003e=500 Internal errors.\n\nYou can use the `WithMaxRetries` option to configure or disable this:\n\n```go\n// Configure the default for all requests:\nclient := imagekit.NewClient(\n\toption.WithMaxRetries(0), // default is 2\n)\n\n// Override per-request:\nfile, err := os.Open(\"/path/to/your/image.jpg\")\nif err != nil {\n\tpanic(err.Error())\n}\ndefer file.Close()\n\nclient.Files.Upload(\n\tcontext.TODO(),\n\timagekit.FileUploadParams{\n\t\tFile:     file,\n\t\tFileName: \"uploaded-image.jpg\",\n\t},\n\toption.WithMaxRetries(5),\n)\n```\n\n### Accessing raw response data (e.g. response headers)\n\nYou can access the raw HTTP response data by using the `option.WithResponseInto()` request option. This is useful when\nyou need to examine response headers, status codes, or other details.\n\n```go\n// Create a variable to store the HTTP response\nvar response *http.Response\n\nfile, err := os.Open(\"/path/to/your/image.jpg\")\nif err != nil {\n\tpanic(err.Error())\n}\ndefer file.Close()\n\nresponse, err = client.Files.Upload(\n\tcontext.TODO(),\n\timagekit.FileUploadParams{\n\t\tFile:     file,\n\t\tFileName: \"uploaded-image.jpg\",\n\t},\n\toption.WithResponseInto(\u0026response),\n)\nif err != nil {\n\t// handle error\n}\nfmt.Printf(\"%+v\\n\", response)\n\nfmt.Printf(\"Status Code: %d\\n\", response.StatusCode)\nfmt.Printf(\"Headers: %+#v\\n\", response.Header)\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.\n`RequestOptions` on the client, such as retries, will be respected when making these requests.\n\n```go\nvar (\n    // params can be an io.Reader, a []byte, an encoding/json serializable object,\n    // or a \"…Params\" struct defined in this library.\n    params map[string]any\n\n    // result can be an []byte, *http.Response, a encoding/json deserializable object,\n    // or a model defined in this library.\n    result *http.Response\n)\nerr := client.Post(context.Background(), \"/unspecified\", params, \u0026result)\nif err != nil {\n    …\n}\n```\n\n#### Undocumented request params\n\nTo make requests using undocumented parameters, you may use either the `option.WithQuerySet()`\nor the `option.WithJSONSet()` methods.\n\n```go\nparams := FooNewParams{\n    ID:   \"id_xxxx\",\n    Data: FooNewParamsData{\n        FirstName: imagekit.String(\"John\"),\n    },\n}\nclient.Foo.New(context.Background(), params, option.WithJSONSet(\"data.last_name\", \"Doe\"))\n```\n\n#### Undocumented response properties\n\nTo access undocumented response properties, you may either access the raw JSON of the response as a string\nwith `result.JSON.RawJSON()`, or get the raw JSON of a particular field on the result with\n`result.JSON.Foo.Raw()`.\n\nAny fields that are not present on the response struct will be saved and can be accessed by `result.JSON.ExtraFields()` which returns the extra fields as a `map[string]Field`.\n\n### Middleware\n\nWe provide `option.WithMiddleware` which applies the given\nmiddleware to requests.\n\n```go\nfunc Logger(req *http.Request, next option.MiddlewareNext) (res *http.Response, err error) {\n\t// Before the request\n\tstart := time.Now()\n\tLogReq(req)\n\n\t// Forward the request to the next handler\n\tres, err = next(req)\n\n\t// Handle stuff after the request\n\tend := time.Now()\n\tLogRes(res, err, start - end)\n\n    return res, err\n}\n\nclient := imagekit.NewClient(\n\toption.WithMiddleware(Logger),\n)\n```\n\nWhen multiple middlewares are provided as variadic arguments, the middlewares\nare applied left to right. If `option.WithMiddleware` is given\nmultiple times, for example first in the client then the method, the\nmiddleware in the client will run first and the middleware given in the method\nwill run next.\n\nYou may also replace the default `http.Client` with\n`option.WithHTTPClient(client)`. Only one http client is\naccepted (this overwrites any previous client) and receives requests after any\nmiddleware has been applied.\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 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.)_\n2. 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-go/issues) with questions, bugs, or suggestions.\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-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fimagekit-developer%2Fimagekit-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimagekit-developer%2Fimagekit-go/lists"}